onChannel/on_channel— events on one channel.onAnyChannel/on_any_channel— every channel event, on any channel.onLifecycle/on_lifecycle— connection state:open,close,reconnect,error.
Channel events
A channel event has anid (the subscription it came from), a channel, and data (the decoded payload).
onChannel(name, …) narrows event.data to that channel’s typed payload; the catch-all events() stream yields AnyChannelPayload. In Python ChannelEvent is generic over the payload and defaults to Any. In Rust data is the typed Payload enum, so match on it and the compiler checks you handle every case.
Lifecycle events
| Event | Payload |
|---|---|
open | — |
close | { code, reason } |
reconnect | { attempt, delayMs } (TS) / { "attempt", "delay" } (Python) / Reconnect { attempt, delay } (Rust) |
error | An Error (often RadionServerError) / Error(RadionError) (Rust) |
on* method returns the client, so you can chain calls. In Rust, channel and lifecycle events come as Streams (events(), per-subscription subscribe(...), and lifecycle()); drop the stream to stop reading. To remove a handler, use the matching off* method (offChannel / off_channel, offAnyChannel / off_any_channel, offLifecycle / off_lifecycle). Leave out the handler to remove all of them for that target.
If one of your handlers throws, the SDK reports it through the
error event
and does not retry it. It never blocks the other handlers from getting the
event.