Legatus.Canalis.Ws.Keepalive (legatus v0.2.0)

Copy Markdown View Source

Canalis.Ws.Keepalive est ritmus vitalis connectionis websocket.

This layer maintains liveness cadence through ping/pong timing. It separates temporal continuity from message semantics.

Its concern is persistence of channel life, not payload meaning.

Summary

Functions

Cancel keepalive timer.

Handle pong response from server.

Initialize keepalive timer in state.

Send ping frame and reschedule next ping.

Functions

cancel(state)

Cancel keepalive timer.

Called during shutdown/termination.

handle_pong(state)

Handle pong response from server.

Logs pong receipt. State unchanged (no action needed).

initialize(state)

Initialize keepalive timer in state.

Schedules first ping and stores timer reference in state. Returns state with :ping_timer field.

send_ping(state)

Send ping frame and reschedule next ping.

Returns updated state with new timer reference.