pub struct CommandRunner<T: Handler> { /* private fields */ }Expand description
Central command dispatcher for the WebSocket session.
Reads Commands from an MPSC channel and dispatches them to the
WebSocketClient. Manages connection lifecycle, reconnection, and
error recovery.
Spawn via CommandRunner::run() — it blocks until shutdown is triggered.
Implementations§
Source§impl<T: Handler> CommandRunner<T>
impl<T: Handler> CommandRunner<T>
pub fn new(rx: CommandRx, ws: Arc<WebSocketClient<T>>) -> Self
pub fn with_config( rx: CommandRx, ws: Arc<WebSocketClient<T>>, config: CommandRunnerConfig, ) -> Self
pub async fn run(self) -> Result<()>
pub fn shutdown_token(&self) -> CancellationToken
pub fn stats(&self) -> &ConnectionStats
pub fn state(&self) -> &ConnectionState
pub fn config(&self) -> &CommandRunnerConfig
Auto Trait Implementations§
impl<T> !RefUnwindSafe for CommandRunner<T>
impl<T> !UnwindSafe for CommandRunner<T>
impl<T> Freeze for CommandRunner<T>
impl<T> Send for CommandRunner<T>
impl<T> Sync for CommandRunner<T>
impl<T> Unpin for CommandRunner<T>
impl<T> UnsafeUnpin for CommandRunner<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more