Interface AmLink
- All Known Implementing Classes:
AutoReconnectAmLink
,DirectAmLink
,GracefulShutdownAmLink
,InitializedAmLink
,PeriodicallyRenewedAmLink
,RetryableAmLink
,StableAmLink
,TopicMultiplexerAmLink
public interface AmLink
Represents a link to AM notification service. This link must be started successfully before use and closed after
use.
There is no need to close an AmLink
after the triggering of the disconnection handler or a start failure.
When an AmLink
has been closed or disconnected it can't be reused otherwise its behaviour is unspecified.
Since the AmLink
may be disconnected, all ongoing promises will fail AFTER the call to the
disconnection handler.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A supplier of AM Link.static interface
A supplier of Resilient AM Link. -
Method Summary
-
Method Details
-
start
Start theAmLink
. TheAmLink
is considered ready for use only when the resulting promise has successfully completed. In case of a failed promise, the instance is considered as already closed.Note that notifications are guaranteed to be received AT LEAST once. Duplicate notification may occur.
- Returns:
- A promise of this
AmLink
's start completion.
-
close
Close theAmLink
and its associated resources. The instance can't be reused afterward.- Returns:
- A promise indicating the
AmLink
has been closed
-
subscribe
Subscribe to an AM topic. After successful subscription, the notification consumer (supplied in will begin receiving notifications on this topic.- Parameters:
topic
- The AM topic to subscribe to.- Returns:
- A promise of a successful subscription to the AM topic.
-
unsubscribe
Unsubscribe from an AM topic. After successful unsubscribe request, the notification consumer will stop receiving notifications on this topic.- Parameters:
topic
- The AM topic to un-subscribe from.- Returns:
- A promise of a successful un-subscription to the AM topic.
-