Package com.epicbot.api.shared.event
Interface IEpicBotEventBus
public interface IEpicBotEventBus
-
Method Summary
Modifier and TypeMethodDescriptionvoidDispatches the provided event to all registered subscribers.voidDispatches the provided event asynchronously to all registered subscribers.voidRegisters the given subscriber.voidunregister(Object subscriber) Unregisters the given subscriber.
-
Method Details
-
register
Registers the given subscriber. All methods in the subscriber and it's parent classes are checked forSubscribeannotation and then added to map of subscriptions.- Parameters:
subscriber- the subscriber- Throws:
IllegalArgumentException- in case subscriber method name is wrong (correct format is 'on' + EventName)
-
unregister
Unregisters the given subscriber.- Parameters:
subscriber- the subscriber
-
post
Dispatches the provided event to all registered subscribers. Blocking until all subscribers have handled the event.- Parameters:
event- event to post
-
postAsync
Dispatches the provided event asynchronously to all registered subscribers.- Parameters:
event- event to post
-