Expand description
The prelude module re-exports the most commonly used traits and types from the workflow_core crate.
Structs§
- Abortable
- Abortable trigger wraps an
Arc<AtomicBool>
, which can be cloned to signal task terminating using an atomic bool. - Channel
Channel
struct that combinesasync_std::channel::Sender
andasync_std::channel::Receiver
into a single struct withsender
andreceiver
members representing a single channel.- Duplex
Channel DuplexChannel
contains 2 channelsrequest
andresponse
meant to provide for a request/response pattern. This is useful for any type of signaling, but especially during task termination, where you can request a task to terminate and wait for a response confirming its termination.- Duration
- A
Duration
type to represent a span of time, typically used for system timeouts. - Multiplexer
- A simple MPMC (one to many) channel Multiplexer that broadcasts to
multiple registered receivers.
Multiplexer<T>
itself can be cloned and used to broadcast usingMultiplexer::broadcast()
orMultiplexer::try_broadcast()
. To create a receiving channel, you can callMultiplexerChannel<T>::from()
and supply the desired Multiplexer instance, or simply callMultiplexer::channel()
to create a newMultiplexerChannel
instance. The receiving channel gets unregistered whenMultiplexerChannel
is dropped or the underlyingReceiver
is closed. - Sendable
- Sendable wrapper for JS primitives.
Traits§
- Describe
- Enum trait used by the
Describe
derive macro - IsNot
Empty Extension - Trait that declares
is_not_empty()
method.
Functions§
- dispatch
- interval
async interval()
function backed by the JavaScriptcreateInterval()
- oneshot
- Creates a oneshot channel (bounded channel with a limit of 1 message)
- sleep
- Waits until
duration
has elapsed. - spawn
- unixtime_
as_ millis_ f64 - unixtime_
as_ millis_ u128 - yield_
executor - Yields execution back to the Tokio runtime.
- yield_
now - Yields execution back to the Tokio runtime.
Type Aliases§
Derive Macros§
- Describe
- Attribute macro for automatic conversion of enums to their string representation