public interface UnicastService
The broadcast service is an unreliable broadcast messaging service backed by multicast. This service provides no guaranteed regarding reliability or order of messages.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
UnicastService.Builder
Broadcast service builder.
|
| Modifier and Type | Method and Description |
|---|---|
default void |
addListener(java.lang.String subject,
java.util.function.BiConsumer<Address,byte[]> listener)
Adds a broadcast listener for the given subject.
|
void |
addListener(java.lang.String subject,
java.util.function.BiConsumer<Address,byte[]> listener,
java.util.concurrent.Executor executor)
Adds a broadcast listener for the given subject.
|
void |
removeListener(java.lang.String subject,
java.util.function.BiConsumer<Address,byte[]> listener)
Removes a broadcast listener for the given subject.
|
void |
unicast(Address address,
java.lang.String subject,
byte[] message)
Broadcasts the given message to all listeners for the given subject.
|
void unicast(Address address, java.lang.String subject, byte[] message)
The message will be broadcast to all listeners for the given subject. This service makes no guarantee
regarding the reliability or order of delivery of the message.
address - the address to which to unicast the messagesubject - the message subjectmessage - the message to broadcastdefault void addListener(java.lang.String subject,
java.util.function.BiConsumer<Address,byte[]> listener)
Messages broadcast to the given subject will be delivered to the provided listener. This service provides
no guarantee regarding the order in which messages arrive.
subject - the message subjectlistener - the broadcast listener to addvoid addListener(java.lang.String subject,
java.util.function.BiConsumer<Address,byte[]> listener,
java.util.concurrent.Executor executor)
Messages broadcast to the given subject will be delivered to the provided listener. This service provides
no guarantee regarding the order in which messages arrive.
subject - the message subjectlistener - the broadcast listener to addexecutor - an executor with which to call the listenervoid removeListener(java.lang.String subject,
java.util.function.BiConsumer<Address,byte[]> listener)
subject - the message subjectlistener - the broadcast listener to removeCopyright © 2013-2019. All Rights Reserved.