Channel State Machine
Implementation of StateMachineGen
ADF channel sender uses the StateMachineGen to implement a state machine. See ChannelSenderEx.Core.Channel
module for the implementation.
State machine description
Steps
-
When the client (web or mobile) calls the registration endpoint
POST /ext/channela new channel process is started with its initial statewaiting. -
When the client (web or mobile) opens a connection [socket/sse/longpoll] connection with the server, internally the process state change to
connected. -
If the connection between client and server is interrupted, the process returns to
waitingstate.The
waitingstate has a timer control, which expects a socket connection (or re-connection) within the time window defined by thechannel_shutdown_socket_disconnectparameter in the configuration yaml (unit time is seconds) in order to return to theconnectedstate.If client the disconnection was clean (the client requested to close), then the process uses the time defined in te configuration
channel_shutdown_socket_disconnect.on_clean_close(default 30 seconds). If this parameter is zero (0) the process is terminated inmediatlly.If client disconection wasn't clean (the client and server lost connection), then the process uses the time defined in te configuration
channel_shutdown_socket_disconnect.on_disconnection(default 300 seconds). If this parameter is zero (0) the process is terminated inmediatlly.