public interface ChannelActions
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<io.netty.channel.Channel> |
connect(com.digitalpetri.strictmachine.FsmContext<State,Event> ctx)
Bootstrap a new
Channel and return a CompletableFuture that completes successfully when the
Channel is ready to use or completes exceptionally if the Channel could not be created or made ready to use for
any reason. |
java.util.concurrent.CompletableFuture<java.lang.Void> |
disconnect(com.digitalpetri.strictmachine.FsmContext<State,Event> ctx,
io.netty.channel.Channel channel)
Perform any disconnect actions and then close
channel, returning a CompletableFuture that
completes successfully when the Channel has disconnected or completes exceptionally if the channel could not be
disconnected for any reason. |
default java.util.concurrent.CompletableFuture<java.lang.Void> |
keepAlive(com.digitalpetri.strictmachine.FsmContext<State,Event> ctx,
io.netty.channel.Channel channel)
Perform a keep-alive action because the Channel has been idle for longer than
maxIdleSeconds. |
java.util.concurrent.CompletableFuture<io.netty.channel.Channel> connect(com.digitalpetri.strictmachine.FsmContext<State,Event> ctx)
Channel and return a CompletableFuture that completes successfully when the
Channel is ready to use or completes exceptionally if the Channel could not be created or made ready to use for
any reason.ctx - the FsmContext.CompletableFuture that completes successfully when the
Channel is ready to use or completes exceptionally if the Channel could not be created or made ready to use for
any reason.java.util.concurrent.CompletableFuture<java.lang.Void> disconnect(com.digitalpetri.strictmachine.FsmContext<State,Event> ctx, io.netty.channel.Channel channel)
channel, returning a CompletableFuture that
completes successfully when the Channel has disconnected or completes exceptionally if the channel could not be
disconnected for any reason.
The state machine advances the same way regardless of how the future is completed.
ctx - the FsmContext.channel - the Channel to disconnect.CompletableFuture that completes successfully when the Channel
* has disconnected or completes exceptionally if the channel could not be disconnected for any reason.default java.util.concurrent.CompletableFuture<java.lang.Void> keepAlive(com.digitalpetri.strictmachine.FsmContext<State,Event> ctx, io.netty.channel.Channel channel)
maxIdleSeconds.
Although the keep-alive action is implementation dependent the intended usage would be to do something send a request that tests the Channel to make sure it's still valid.
ctx - the FsmContextchannel - the Channel to send the keep-alive on.CompletableFuture that completes successfully if the channel is still valid and completes
exceptionally otherwise.