Class QueueDrivenEventManager
- java.lang.Object
- 
- com.inductiveautomation.perspective.gateway.event.QueueDrivenEventManager
 
- 
- All Implemented Interfaces:
- EventManager
 
 public class QueueDrivenEventManager extends java.lang.Object implements EventManager 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface com.inductiveautomation.perspective.gateway.api.EventManagerEventManager.ListenerExceptionHandler, EventManager.Subscription
 
- 
 - 
Constructor SummaryConstructors Constructor Description QueueDrivenEventManager(ExecutionQueue queue)QueueDrivenEventManager(ExecutionQueue queue, EventManager.ListenerExceptionHandler exceptionHandler)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description <E> voidpost(E event)Post an event to all subscribers of the given event type.<E> voidpost(java.lang.Class<E> eventType, E event)Post an event object and specify the precise type of listeners to deliver to.<E> EventManager.Subscriptionsubscribe(java.lang.Class<E> eventType, java.util.function.Consumer<E> eventConsumer)Create a subscription for the given event type.
 
- 
- 
- 
Constructor Detail- 
QueueDrivenEventManagerpublic QueueDrivenEventManager(@Nonnull ExecutionQueue queue)
 - 
QueueDrivenEventManagerpublic QueueDrivenEventManager(@Nonnull ExecutionQueue queue, @Nonnull EventManager.ListenerExceptionHandler exceptionHandler)
 
- 
 - 
Method Detail- 
subscribe@Nonnull public <E> EventManager.Subscription subscribe(@Nonnull java.lang.Class<E> eventType, @Nonnull java.util.function.Consumer<E> eventConsumer) Description copied from interface:EventManagerCreate a subscription for the given event type. Events of this type will be delivered to the given consumer until theEventManager.Subscription.unsubscribe()method is called.- Specified by:
- subscribein interface- EventManager
- Parameters:
- eventType- The type of event to subscribe to.
- eventConsumer- The listener which will be invoked with any events of the given type that are posted to this event manager. Consumer will always be invoked on the session's queue.
- Returns:
- A Subscription object that serves as an un-subscribe callback method.
 
 - 
postpublic <E> void post(@Nonnull E event)Description copied from interface:EventManagerPost an event to all subscribers of the given event type. Subscribers will receive notification on-queue. If the calling thread is already executing on-queue, then delivery will happen synchronously, otherwise, this call will return immediately and notification will happen asynchronously on the execution queue.- Specified by:
- postin interface- EventManager
- Parameters:
- event- The event to post. The type of this object will determine which listeners are notified.
 
 - 
postpublic <E> void post(@Nonnull java.lang.Class<E> eventType, @Nonnull E event)Description copied from interface:EventManagerPost an event object and specify the precise type of listeners to deliver to. Useful for when you are posting a subclass or implementation of the type being listened to- Specified by:
- postin interface- EventManager
 
 
- 
 
-