ControlEvents
Receives tmux notifications and terminal connection errors.
Source and package
- Qualified name
-
libtmux::control:: Control Events - Module
- control
- Package
- libtmux
- Source
- crates/libtmux/src/control.rs
-
Description#
This is a
Stream<Item = Result<Event, Error>>. Notifications arrive in order. A connection failure follows all buffered notifications as oneErr; subsequent polls returnNone. A normal tmux%exitarrives asEvent::Exitand is followed byNoneafter cleanup succeeds. EOF without%exitiscrate::ControlModeErrorKind::Closed.Server::shutdown()may discard notifications still waiting for delivery so an unread stream cannot prevent executor shutdown.Exhaustion waits for connection cleanup.
Self::shutdown()closes early and returns any terminal error the stream has not already delivered.Events are buffered, and a consumer that stops reading eventually stops the connection reading from tmux, which is the backpressure tmux already expects from a slow client. During normal operation nothing is dropped; commands wait instead. Drop this handle to opt out of events entirely and the connection runs on.
Members2#
- next_event method Return the next notification or terminal error, then
None. - shutdown method End the connection and report how it went.