Skip to main content

Crate doido_cable

Crate doido_cable 

Source

Re-exports§

pub use cable::Cable;
pub use channel::Channel;
pub use channel::ChannelContext;
pub use channel::ChannelName;
pub use config::build_configured_pubsub;
pub use config::CableConfig;
pub use connection::CableConnection;
pub use server::handle_socket;
pub use server::route as cable_route;
pub use server::ws_handler;
pub use server::ChannelRegistry;
pub use protocol::CableFrame;
pub use protocol::ServerFrame;
pub use protocol::ServerMessage;
pub use pubsub::MemoryPubSub;
pub use pubsub::PubSub;

Modules§

cable
channel
config
Config-driven pub/sub selection for the cable server, read from the cable section of config/<env>.yml. Mirrors the config modules in doido-jobs/doido-cache: callers only ever see an Arc<dyn PubSub>.
connection
Cable connection identity + authorization (Rails identified_by / reject_unauthorized_connection).
heartbeat
ActionCable heartbeat pings. Apps drive a periodic timer (e.g. a tokio interval) and send ping_now frames to keep connections alive.
protocol
pubsub
server
The live WebSocket cable server: an axum ws upgrade handler that speaks the ActionCable wire protocol, a ChannelRegistry routing subscriptions to Channel handlers, a heartbeat ping loop, and a pub/sub bridge so broadcasts reach subscribed clients.
streams
Stream-name helpers (Rails stream_from / stream_for).

Macros§

cable
Build an axum Router mounting the cable endpoint (/cable) for the given channels over a pub/sub backend (Rails’ mount ActionCable.server):

Functions§

pubsub_from_config
Build the pub/sub backend selected by the cable section of config/<env>.yml (in-memory when absent), connecting the database for the db backend. Pair with cable! to mount the endpoint:

Attribute Macros§

channel
Marks a struct as a WebSocket channel.
channel_macro
Marks a struct as a WebSocket channel.