Struct dharma::signaler::Signaler [] [src]

pub struct Signaler<P> where
    P: Clone + Send
{ /* fields omitted */ }

Signaler allows to send events (or notifications) to other parts of application possibly running in different threads. Signaler is generic over sent data type, meaning that it can convey only data of given type (therefore easiest is to choose enum).

Methods

impl<P> Signaler<P> where
    P: Clone + Send
[src]

Signaler constructor.

Subscribe given receiver for a signal id.

Register receiver for control instructions like request to terminate.

Emit signal id containing data package. All subscribed Receivers will be notified.

Send Terminate instruction to registered Receivers indicating Signaler (possibly whole application) is going to shut down.

Trait Implementations

impl<P> Clone for Signaler<P> where
    P: Clone + Send
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more