N
- the type of notificationspublic interface NotificationPublishService<N>
Users of this interface can publish any YANG-modeled notification which will be delivered to all subscribed listeners.
Preferred way of publishing of notifications is done by invoking publish(Object)
.
You may consider using publish(Object, ExecutorService)
if and only if
your use-case requires customized execution policy or run-to-completion
inside process.
The metadata required to deliver a notification to the correct listeners is extracted from the published notification.
FIXME: Consider clarification of execution/delivery policy, how it will be affected by Actor model and cluster-wide notifications.
Modifier and Type | Method and Description |
---|---|
void |
publish(N notification)
Publishes a notification and notifies subscribed listeners.
|
void |
publish(N notification,
ExecutorService executor)
Publishes a notification and notifies subscribed listeners.
|
void publish(N notification)
Note: This call will block when the default executor is saturated and the notification queue for this executor is full.
notification
- the notification to publish.void publish(N notification, ExecutorService executor)
Note: Use only if necessary. Consider using
publish(Object)
for most use-cases.
By using this method you could customize execution policy of listeners present inside process (e.g. using single-threaded executor or even same-thread executor delivery.
This executor is used only for inside-process notification deliveries.
notification
- the notification to publish.executor
- the executor that will be used to deliver notifications to
subscribed listeners.Copyright © 2019 OpenDaylight. All rights reserved.