T - the channel message typepublic interface Channel<T> extends TypeAware<T>
Channels can be subscribed to through a ChannelAgent.
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Gets the name of the channel.
|
TypeToken<T> |
getType()
Gets the channels message type.
|
ChannelAgent<T> |
newAgent()
Creates a new
ChannelAgent for this channel. |
CompletableFuture<Boolean> |
sendMessage(T message)
Sends a new message to the channel.
|
@Nonnull ChannelAgent<T> newAgent()
ChannelAgent for this channel.@Nonnull CompletableFuture<Boolean> sendMessage(@Nonnull T message)
This method will return immediately, and the future will be completed once the message has been sent.
The future will return true if the message was sent successfully.
message - the message to dispatchCopyright © 2017. All rights reserved.