enqueueEmit<Arg> method
Enqueues an event to be processed by its listeners.
Calls each of the listeners registered for the event named event
in order.
If several asynchronous listeners are registered for this event, they may run concurrently.
However, all (asynchronous) listeners are guaranteed to execute before the next event is processed.
If the error
event is emitted and the emitter does not have at least one listener registered for it,
the error is thrown.
@param event The event to emit.
@param args The arguments to pass to the listeners.
Implementation
void enqueueEmit<Arg>(String event, Arg arg) {
_eventQueue.add((event: event, arg: arg));
if (_processing == null) {
_processQueue();
}
}