Interface IEpicBotEventBus


public interface IEpicBotEventBus
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    post(Object event)
    Dispatches the provided event to all registered subscribers.
    void
    Dispatches the provided event asynchronously to all registered subscribers.
    void
    register(Object subscriber)
    Registers the given subscriber.
    void
    unregister(Object subscriber)
    Unregisters the given subscriber.
  • Method Details

    • register

      void register(Object subscriber)
      Registers the given subscriber. All methods in the subscriber and it's parent classes are checked for Subscribe annotation 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

      void unregister(Object subscriber)
      Unregisters the given subscriber.
      Parameters:
      subscriber - the subscriber
    • post

      void post(Object event)
      Dispatches the provided event to all registered subscribers. Blocking until all subscribers have handled the event.
      Parameters:
      event - event to post
    • postAsync

      void postAsync(Object event)
      Dispatches the provided event asynchronously to all registered subscribers.
      Parameters:
      event - event to post