Behaviours: gen_server.
Authors: Steve Roques.
WebSocket Client for em_disco Connectivity
Manages a single persistent WebSocket connection to ONE em_disco node. em_filter_sup starts one server per configured disco node.
Transport is determined by em_filter_sup:read_disco_nodes/0: tcp — plain WebSocket (ws://) tls — TLS WebSocket (wss://)
TLS uses verify_peer with the system CA store and sets SNI to the target host dynamically so wildcard certificates (*.roques.me) are accepted correctly by the Erlang SSL stack.
1. Open a Gun connection (tcp or tls) to the disco address. 2. Upgrade to WebSocket on /ws. 3. Send a register frame to announce the agent name. 4. Send an agent_hello frame with capabilities (if any). 5. Initialise the memory backend.
| code_change/3 | |
| handle_call/3 | |
| handle_cast/2 | |
| handle_info/2 | |
| init/1 | |
| start_link/4 | Starts a server linked to one specific disco node. |
| terminate/2 |
code_change(OldVsn, State, Extra) -> any()
handle_call(Req, From, State) -> any()
handle_cast(Msg, State) -> any()
handle_info(Info, State) -> any()
init(X1) -> any()
start_link(AgentName::atom(), HandlerModule::module(), Config::map(), X4::{string(), inet:port_number(), tcp | tls}) -> {ok, pid()} | {error, term()}
Starts a server linked to one specific disco node.
The server name encodes host + port so multiple workers for the same agent have distinct registered names: rss_filter_localhost_8080_server rss_filter_em_disco_roques_me_443_serverterminate(Reason, State) -> any()
Generated by EDoc