T - topic message type.public class DefaultDistributedTopic<T> extends Object implements Topic<T>
Topic.DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERTATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
destroy()
Purges state associated with this primitive.
|
String |
name()
Returns the name of this primitive.
|
DistributedPrimitive.Type |
primitiveType()
Returns the type of primitive.
|
CompletableFuture<Void> |
publish(T message)
Publishes a message to all subscribers.
|
CompletableFuture<Void> |
subscribe(Consumer<T> callback,
Executor executor)
Subscribes to messages published to this topic.
|
CompletableFuture<Void> |
unsubscribe(Consumer<T> callback)
Unsubscribes from this topic.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddStatusChangeListener, applicationId, removeStatusChangeListener, statusChangeListenerspublic String name()
DistributedPrimitivename in interface DistributedPrimitivepublic DistributedPrimitive.Type primitiveType()
DistributedPrimitiveprimitiveType in interface DistributedPrimitivepublic CompletableFuture<Void> destroy()
DistributedPrimitiveImplementations can override and provide appropriate clean up logic for purging any state state associated with the primitive. Whether modifications made within the destroy method have local or global visibility is left unspecified.
destroy in interface DistributedPrimitiveCompletableFuture that is completed when the operation completespublic CompletableFuture<Void> publish(T message)
TopicThe message is delivered in a asynchronous fashion which means subscribers will receive the message eventually but not necessarily before the future returned by this method is completed.
public CompletableFuture<Void> subscribe(Consumer<T> callback, Executor executor)
Topicpublic CompletableFuture<Void> unsubscribe(Consumer<T> callback)
Topicunsubscribe in interface Topic<T>callback - previously subscribed callback