public interface SubscriptionsManager
A manager of subscriptions to the events occurring in a Hotmoka node.
-
Method Summary
Modifier and TypeMethodDescriptionvoidnotifyEvent(StorageReference creator, StorageReference event) Notifies the given event to all event handlers for the given creator.subscribeToEvents(StorageReference creator, BiConsumer<StorageReference, StorageReference> handler) Subscribes the given handler for events with the given creator.
-
Method Details
-
subscribeToEvents
Subscription subscribeToEvents(StorageReference creator, BiConsumer<StorageReference, StorageReference> handler) 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 isnull, all events will be forwarded to the handlerhandler- 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
Notifies the given event to all event handlers for the given creator.- Parameters:
creator- the creator of the eventevent- the event to notify
-