pub(crate) struct InFlight {
calls: Option<Arc<Sender<Calls>>>,
seq: u64,
pending: Option<PendingPid>,
stop: CancellationToken,
}Expand description
Counts a runtime call as in progress until dropped. A successful
ChildReaper::create_child hands it to the caller, which passes it to
ChildReaper::watch_grandchild, so the call ends with the registration
of its child, or wherever the caller gives up.
Fields§
§calls: Option<Arc<Sender<Calls>>>§seq: u64The number of the call, see Calls.
pending: Option<PendingPid>Keeps the process which the call started pending until the call
ends, also if the call gets dropped before its registration, see
InFlight::claim.
stop: CancellationTokenCancelled once the shutdown stops the call, see
ChildReaper::stop_calls.
Implementations§
Source§impl InFlight
impl InFlight
Sourcefn claim(&mut self, pending: &Arc<Mutex<HashMap<Pid, usize>>>, pid: Pid)
fn claim(&mut self, pending: &Arc<Mutex<HashMap<Pid, usize>>>, pid: Pid)
Mark the process pid which the call started as pending until the
call ends, and record it for the shutdown, which kills it if the
call does not end in time, see ChildReaper::kill_pending. It is
pending before it gets recorded. A shutdown which did not see the
record stopped the call before it looked at the calls, so the call
sees that here and kills the process itself.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InFlight
impl RefUnwindSafe for InFlight
impl Send for InFlight
impl Sync for InFlight
impl Unpin for InFlight
impl UnsafeUnpin for InFlight
impl UnwindSafe for InFlight
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].