Function chan::after_ms [] [src]

pub fn after_ms(duration: u32) -> Receiver<()>

Creates a new rendezvous channel that is dropped after a timeout.

duration is specified in milliseconds.

When the channel is dropped, any receive operation on the returned channel will be unblocked.

N.B. This will eventually be deprecated when we get a proper duration type.

Example

let wait = chan::after_ms(1000);
// Unblocks after 1 second.
wait.recv();