public interface MessagingService
| Modifier and Type | Interface and Description |
|---|---|
static class |
MessagingService.Builder
Messaging service builder.
|
| Modifier and Type | Method and Description |
|---|---|
io.atomix.utils.net.Address |
address()
Returns the local messaging service address.
|
void |
registerHandler(String type,
BiConsumer<io.atomix.utils.net.Address,byte[]> handler,
Executor executor)
Registers a new message handler for message type.
|
void |
registerHandler(String type,
BiFunction<io.atomix.utils.net.Address,byte[],byte[]> handler,
Executor executor)
Registers a new message handler for message type.
|
void |
registerHandler(String type,
BiFunction<io.atomix.utils.net.Address,byte[],CompletableFuture<byte[]>> handler)
Registers a new message handler for message type.
|
CompletableFuture<byte[]> |
sendAndReceive(io.atomix.utils.net.Address address,
String type,
byte[] payload)
Sends a message asynchronously and expects a response.
|
CompletableFuture<byte[]> |
sendAndReceive(io.atomix.utils.net.Address address,
String type,
byte[] payload,
Duration timeout)
Sends a message asynchronously and expects a response.
|
CompletableFuture<byte[]> |
sendAndReceive(io.atomix.utils.net.Address address,
String type,
byte[] payload,
Duration timeout,
Executor executor)
Sends a message synchronously and expects a response.
|
CompletableFuture<byte[]> |
sendAndReceive(io.atomix.utils.net.Address address,
String type,
byte[] payload,
Executor executor)
Sends a message synchronously and expects a response.
|
CompletableFuture<Void> |
sendAsync(io.atomix.utils.net.Address address,
String type,
byte[] payload)
Sends a message asynchronously to the specified communication address.
|
void |
unregisterHandler(String type)
Unregister current handler, if one exists for message type.
|
io.atomix.utils.net.Address address()
CompletableFuture<Void> sendAsync(io.atomix.utils.net.Address address, String type, byte[] payload)
address - address to send the message to.type - type of message.payload - message payload bytes.CompletableFuture<byte[]> sendAndReceive(io.atomix.utils.net.Address address, String type, byte[] payload)
address - address to send the message to.type - type of message.payload - message payload.CompletableFuture<byte[]> sendAndReceive(io.atomix.utils.net.Address address, String type, byte[] payload, Executor executor)
address - address to send the message to.type - type of message.payload - message payload.executor - executor over which any follow up actions after completion will be executed.CompletableFuture<byte[]> sendAndReceive(io.atomix.utils.net.Address address, String type, byte[] payload, Duration timeout)
address - address to send the message to.type - type of message.payload - message payload.timeout - response timeoutCompletableFuture<byte[]> sendAndReceive(io.atomix.utils.net.Address address, String type, byte[] payload, Duration timeout, Executor executor)
address - address to send the message to.type - type of message.payload - message payload.timeout - response timeoutexecutor - executor over which any follow up actions after completion will be executed.void registerHandler(String type, BiConsumer<io.atomix.utils.net.Address,byte[]> handler, Executor executor)
type - message type.handler - message handlerexecutor - executor to use for running message handler logic.void registerHandler(String type, BiFunction<io.atomix.utils.net.Address,byte[],byte[]> handler, Executor executor)
type - message type.handler - message handlerexecutor - executor to use for running message handler logic.void registerHandler(String type, BiFunction<io.atomix.utils.net.Address,byte[],CompletableFuture<byte[]>> handler)
type - message type.handler - message handlervoid unregisterHandler(String type)
type - message typeCopyright © 2013–2018. All rights reserved.