Package io.atomix.cluster.messaging
Interface Subscription
public interface Subscription
ClusterEventService subscription context.
The subscription represents a node's subscription to a specific topic. A Subscription instance is returned
once an ClusterEventService subscription has been propagated. The subscription context can be used to
unsubscribe the node from the given topic() by calling close().
-
Method Summary
Modifier and Type Method Description CompletableFuture<Void>close()Closes the subscription, causing it to be unregistered.Stringtopic()Returns the subscription topic.
-
Method Details
-
topic
String topic()Returns the subscription topic.- Returns:
- the topic to which the subscriber is subscribed
-
close
CompletableFuture<Void> close()Closes the subscription, causing it to be unregistered.When the subscription is closed, the subscriber will be unregistered and the change will be propagated to all the members of the cluster. The returned future will be completed once the change has been propagated to all nodes.
- Returns:
- a future to be completed once the subscription has been closed
-