[][src]Module suspend_core::listen

Utilities for waiting on notifications.

Structs

Listener

A structure providing thread parking and notification operations.

ListenerGuard

An exclusive guard around a Listener instance.

Notifier

Used to notify an associated Listener instance.

Functions

block_on

Block the current thread on the result of a Future.

block_on_poll

Block the current thread on the result of a poll function, with an optional timeout. A None value is returned if the timeout is reached.

block_on_unpin

Block the current thread on the result of a Future + Unpin, with an optional timeout. A None value is returned if the timeout is reached.

park_thread

Park the current thread until notified, with an optional timeout. If a timeout is specified and reached before there is a notification, then a false value is returned. Note that this function is susceptible to spurious notifications. Use a dedicated Listener instance if this is undesirable.