Publish an event asynchronously to all subscribers
The event type to publish
Optional
event: anyOptional event data to pass to handlers
The number of subscribers that were called
Publish an event synchronously to all subscribers
The event type to publish
Optional
event: anyOptional event data to pass to handlers
The number of subscribers that were called
Subscribe to an event type with a handler function
The event type to subscribe to
The function to call when the event is published
The index of the subscriber for later unsubscription
Unsubscribe a specific handler by its index
The event type to unsubscribe from
The index of the subscriber to remove
Unsubscribe all handlers for a specific event type
The event type to unsubscribe all handlers from
The handler function to remove (all instances)
Interface for event publish-subscribe pattern implementation Provides methods for subscribing to events, unsubscribing, and publishing events