gabsurd/event

Event operations for the Absurd durable workflow system. Provides functions for emitting and awaiting events.

Types

Result of an await_event call.

pub type AwaitResult {
  AwaitResult(should_suspend: Bool, payload: String)
}

Constructors

  • AwaitResult(should_suspend: Bool, payload: String)

Values

pub fn await(
  db: client.Db,
  queue_name: String,
  task_id: BitArray,
  run_id: BitArray,
  step_name: String,
  event_name: String,
  timeout: Int,
) -> Result(AwaitResult, client.GabsurdError)

Await an event for a specific task step. Returns an AwaitResult indicating whether the task should suspend (no event available) or continue (event received).

pub fn emit(
  db: client.Db,
  queue_name: String,
  event_name: String,
  payload: json.Json,
) -> Result(Nil, client.GabsurdError)

Emit an event to a queue.

Search Document