Scheduler
Constructor Summary
| Public Constructor | ||
| public |
constructor(options: object) |
|
Member Summary
| Public Members | ||
| public |
options: * |
|
| public |
The list of pending QueueItem. |
|
| public |
The registry of Workers. |
|
Method Summary
| Public Methods | ||
| public |
Actually sends a QueueItem message to a worker. |
|
| public |
prime() Primes the Scheduler to have the same number of Workers as the specified limit. |
|
| public |
Sends a message to a worker. |
|
Public Constructors
Public Members
public options: * source
Public Methods
public handle(item: QueueItem, worker: Worker) source
Actually sends a QueueItem message to a worker.
This method is in charge of calling Worker.postMessage with the QueueItem.message. It's also in charge
of setting the Worker's idle state. The idle state is what prevents multiple messages from being sent to the
same worker.
Params:
| Name | Type | Attribute | Description |
| item | QueueItem | The queue item |
|
| worker | Worker | The worker |