Package org.apache.sling.scripting.sightly.js.impl.loop

# Class EventLoop

java.lang.Object
org.apache.sling.scripting.sightly.js.impl.loop.EventLoop

public class EventLoop extends Object
Simulates an event loop for the Rhino JS engine.

## Constructor Summary

Constructors
Constructor
Description
`EventLoop()`

## Method Summary

Modifier and Type
Method
Description
`void`
`schedule(Task task)`
Add a task to the queue.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### EventLoop

public EventLoop()

## Method Details

### schedule

public void schedule(Task task)
Add a task to the queue. If the queue is empty, start running tasks. If it isn't empty, continue running the available tasks

Parameters:
  `task` - the task to be added