Interface SubscriptionsManager


public interface SubscriptionsManager
A manager of subscriptions to the events occurring in a Hotmoka node.
  • Method Details

    • subscribeToEvents

      Subscribes the given handler for events with the given creator.
      Parameters:
      creator - the creator of the events that will be forwarded to the handler; if this is null, all events will be forwarded to the handler
      handler - a handler that gets executed when an event with the given creator occurs; a handler can be subscribed to more creators; for each event, it receives its creator and the event itself
      Returns:
      the subscription, that can be closed later to stop event handling with handler
    • notifyEvent

      void notifyEvent(StorageReference creator, StorageReference event)
      Notifies the given event to all event handlers for the given creator.
      Parameters:
      creator - the creator of the event
      event - the event to notify