pub struct Ticket {
answer: Receiver<Result<Outcome, Error>>,
cancel: CancelToken,
delivered: bool,
segmenter: Option<JoinHandle<()>>,
}Expand description
A transcription in flight. On the pipelined capture path this is the take’s AGGREGATE: it resolves once every segment and the tail have run and the join has been normalized once.
Fields§
§answer: Receiver<Result<Outcome, Error>>§cancel: CancelToken§delivered: boolSet once the answer is in hand. A delivered ticket’s own drop is not
an abandonment: on the direct path the diagnostics record is written
after the answer goes out, and the drop’s cancel would delete the
take the worker is still writing. A host’s clone from
Ticket::cancel_token keeps sharing the flag, so abandoning the
take after the answer still cancels it.
segmenter: Option<JoinHandle<()>>The take’s segmenter, on the capture path. Joined so no take
thread outlives the value that owns its result; it holds no
native state, so the join is tidiness and not the teardown
guarantee - that is the worker join in Engine::drop.
Implementations§
Source§impl Ticket
impl Ticket
Sourcepub fn recv(self) -> Result<Outcome, Error>
pub fn recv(self) -> Result<Outcome, Error>
Wait for the result.
BLOCKING, and deliberately without an async twin: an async host
wraps this in its own spawn_blocking, where the reverse would
put a runtime in every consumer to serve one.
Sourcepub fn cancel_token(&self) -> CancelToken
pub fn cancel_token(&self) -> CancelToken
A clone of this ticket’s cancel token. Cancelling it aborts THIS transcription - a job still queued behind another takes the token with it and is aborted when its turn comes - which is why a host abandoning one take among several goes through here rather than through anything engine-wide.