Interface EventBus

    • Method Detail

      • publish

        void publish​(Object event)
        Send the event to all interested subscribers.
        Parameters:
        event - the event to publish
      • reactTo

        <T> SubscriptionId reactTo​(Class<T> tClass,
                                   Consumer<T> consumer)
        Adds the Consumer as Subscriber for the given event class.
        Type Parameters:
        T - the type of the event
        Parameters:
        tClass - the class of the event
        consumer - the Consumer to be called
        Returns:
        the Subscriber's SubscriptionId
      • unsubscribe

        void unsubscribe​(SubscriptionId subscriptionId)
        Removes all Subscribers matching the given SubscriptionId.
        Parameters:
        subscriptionId - the SubscriptionId to be removed