Struct minion::Handle [] [src]

pub struct Handle<E> { /* fields omitted */ }

A handle to a running service loop.

You can use it to cancel the running loop at the next opportunity (through [Handle::cancel]), or to wait for the loop to terminate (through [Handle::wait]). You can also use [Handle::canceller] to get a [Canceller] handle, which lets you terminate the service loop elsewhere (e.g., while waiting).

Methods

impl<E> Handle<E>
[src]

[src]

Get another handle for cancelling the service loop.

This can be handy if you want one thread to wait for the service loop to exit, while another watches for exit signals.

[src]

Wait for the service loop to exit, and return its result.

If the service loop panics, this method will also panic with the same error.

Methods from Deref<Target = Canceller>

[src]

Cancel the currently running service loop.

Note that this will not interrupt a currently executing [Cancellable::for_each]. Instead, the next time [Cancellable::for_each] would be called, the service loop will return.

Trait Implementations

impl<E> Deref for Handle<E>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

Auto Trait Implementations

impl<E> Send for Handle<E> where
    E: Send

impl<E> Sync for Handle<E> where
    E: Sync