Constructor
new EventQueue(type, consumeFn)
Private constructor.
Parameters:
Name | Type | Description |
---|---|---|
type |
"none" | "single" | "per_room" | The type of event queue to create. |
consumeFn |
consumeCallback | Function which is called when an event is consumed. |
- Source:
Methods
(static) create(consumeFn) → {EventQueue}
Factory for EventQueues.
Parameters:
Name | Type | Description |
---|---|---|
opts.type |
"none" | "single" | "per_room" | Type of the queue to create. |
consumeFn |
consumeCallback | Function which is called when an event is consumed. |
- Source:
Returns:
The newly created EventQueue.
- Type
- EventQueue
consume()
Starts consuming the queue.
As long as events are enqueued they will continue to be consumed.
- Source:
push(event, dataReady)
Push the event and its related data to the queue.
Parameters:
Name | Type | Description |
---|---|---|
event |
IMatrixEvent | The event to enqueue. |
dataReady |
Promise.<object> | Promise containing data related to the event. |
- Source: