pub(crate) struct StdioSender {
pub(super) tx: Sender<Message>,
consumed: Arc<AtomicBool>,
}Expand description
The sending half of a stdio channel, which a read loop forwards the output of its pipe to.
Until a consumer attached, see ContainerIO::consume_stdio, the channel
keeps the latest chunks only and drops the oldest one when it is full. The
output of a container must never wait for a consumer which may not exist,
only the stderr of a failed runtime is of interest. Once one attached, a
full channel makes the read loop wait, so that a slow consumer gets all
output and the process waits for it instead. An exec gets its consumer
before its runtime starts, see ContainerIO::collect_stdio. The
consumer closes the channel when it is done, the read loop drops the
sender then and keeps reading the pipe.
Fields§
§tx: Sender<Message>§consumed: Arc<AtomicBool>Implementations§
Source§impl StdioSender
impl StdioSender
Sourcepub(crate) fn new(tx: Sender<Message>, consumed: &Arc<AtomicBool>) -> Self
pub(crate) fn new(tx: Sender<Message>, consumed: &Arc<AtomicBool>) -> Self
A sender on tx, whose consumer sets consumed once it attached.
Sourcepub(super) fn consumed(&self) -> bool
pub(super) fn consumed(&self) -> bool
Whether a consumer reads the channel, see
ContainerIO::consume_stdio.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StdioSender
impl RefUnwindSafe for StdioSender
impl Send for StdioSender
impl Sync for StdioSender
impl Unpin for StdioSender
impl UnsafeUnpin for StdioSender
impl UnwindSafe for StdioSender
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].