Module workflow_rs::core::prelude  
source · Expand description
The prelude module re-exports the most commonly used traits and types from the workflow_core crate.
Structs§
- Abortable trigger wraps anArc<AtomicBool>, which can be cloned to signal task terminating using an atomic bool.
- Channelstruct that combines- async_std::channel::Senderand- async_std::channel::Receiverinto a single struct with- senderand- receivermembers representing a single channel.
- DuplexChannelcontains 2 channels- requestand- responsemeant 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.
- ADurationtype to represent a span of time, typically used for system timeouts.
- 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 newMultiplexerChannelinstance. The receiving channel gets unregistered whenMultiplexerChannelis dropped or the underlyingReceiveris closed.
- Sendable wrapper for JS primitives.
Traits§
- Trait that declaresis_not_empty()method.
Functions§
- async interval()function backed by the JavaScript- createInterval()
- Creates a oneshot channel (bounded channel with a limit of 1 message)
- Waits untildurationhas elapsed.
- Yields execution back to the Tokio runtime.
- Yields execution back to the Tokio runtime.
Type Aliases§
Derive Macros§
- Attribute macro for automatic conversion of enums to their string representation