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 an Arc<AtomicBool>, which can be cloned to signal task terminating using an atomic bool.
  • Channel struct that combines [async_std::channel::Sender] and [async_std::channel::Receiver] into a single struct with sender and receiver members representing a single channel.
  • DuplexChannel contains 2 channels request and response 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.
  • A Duration type 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 using Multiplexer::broadcast() or Multiplexer::try_broadcast(). To create a receiving channel, you can call MultiplexerChannel<T>::from() and supply the desired Multiplexer instance, or simply call Multiplexer::channel() to create a new MultiplexerChannel instance. The receiving channel gets unregistered when MultiplexerChannel is dropped or the underlying Receiver is closed.
  • Sendable wrapper for JS primitives.

Traits

Functions

Type Aliases

Derive Macros

  • Attribute macro for automatic conversion of enums to their string representation