emit abstract method
Emits an event to all its registered listeners.
Listeners are executed in priority order. If any listener throws, implementations should catch and handle exceptions to prevent disrupting other listeners.
event: The event name to emit.payload: Optional data passed to listeners.queue: If true, queue the emission for async processing.
Returns a Future that completes when all listeners have finished.
Example:
await events.emit('user.updated', {'userId': 123, 'changes': {...}});
Implementation
Future<void> emit(
String event, [
dynamic payload,
bool queue = false,
]);