public interface MessagingService
| Modifier and Type | Method and Description |
|---|---|
void |
registerHandler(String type,
java.util.function.Consumer<byte[]> handler,
Executor executor)
Registers a new message handler for message type.
|
void |
registerHandler(String type,
java.util.function.Function<byte[],byte[]> handler,
Executor executor)
Registers a new message handler for message type.
|
void |
registerHandler(String type,
java.util.function.Function<byte[],CompletableFuture<byte[]>> handler)
Registers a new message handler for message type.
|
CompletableFuture<byte[]> |
sendAndReceive(Endpoint ep,
String type,
byte[] payload)
Sends a message synchronously and waits for a response.
|
CompletableFuture<Void> |
sendAsync(Endpoint ep,
String type,
byte[] payload)
Sends a message asynchronously to the specified communication end point.
|
void |
unregisterHandler(String type)
Unregister current handler, if one exists for message type.
|
CompletableFuture<Void> sendAsync(Endpoint ep, String type, byte[] payload)
ep - end point to send the message to.type - type of message.payload - message payload bytes.CompletableFuture<byte[]> sendAndReceive(Endpoint ep, String type, byte[] payload)
ep - end point to send the message to.type - type of message.payload - message payload.void registerHandler(String type, java.util.function.Consumer<byte[]> handler, Executor executor)
type - message type.handler - message handlerexecutor - executor to use for running message handler logic.void registerHandler(String type, java.util.function.Function<byte[],byte[]> handler, Executor executor)
type - message type.handler - message handlerexecutor - executor to use for running message handler logic.void registerHandler(String type, java.util.function.Function<byte[],CompletableFuture<byte[]>> handler)
type - message type.handler - message handlervoid unregisterHandler(String type)
type - message typeCopyright © 2015. All rights reserved.