Class: EventQueue

EventQueue(type, consumeFn)

Handles the processing order of incoming Matrix events. Events can be pushed to the queue and will be processed when their corresponding data is ready and they are at the head of line. Different types of queues can be chosen for the processing order of events. Abstract Base Class. Use the factory method `create` to create new instances.

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: