pub struct PipelineRun { /* private fields */ }Expand description
A pipeline running on its own OS thread, with its exit result delivered
over a channel so tests can wait with a bounded recv_timeout instead of
polling JoinHandle::is_finished.
Implementations§
Source§impl PipelineRun
impl PipelineRun
Sourcepub fn spawn(
run: impl FnOnce() -> Result<ExitReport, StartError> + Send + 'static,
) -> Self
pub fn spawn( run: impl FnOnce() -> Result<ExitReport, StartError> + Send + 'static, ) -> Self
Spawn run (typically move || runtime.run()) on a new thread; its
result is sent over the channel when it returns.
Sourcepub fn wait_exit(
&self,
timeout: Duration,
) -> Option<Result<ExitReport, StartError>>
pub fn wait_exit( &self, timeout: Duration, ) -> Option<Result<ExitReport, StartError>>
Block until the pipeline exits or timeout elapses; None on timeout.
Use this to wait for a pipeline that stops on its own (e.g. a
Fail-policy fatal) without a manual shutdown trigger.
Sourcepub fn join(self) -> Result<ExitReport, StartError>
pub fn join(self) -> Result<ExitReport, StartError>
Block until the pipeline exits and join its thread, returning the run result. Panics if the thread panicked.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PipelineRun
impl !UnwindSafe for PipelineRun
impl Freeze for PipelineRun
impl Send for PipelineRun
impl Sync for PipelineRun
impl Unpin for PipelineRun
impl UnsafeUnpin for PipelineRun
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