OxL Reference

fn pipeScope

Runs the front of a pipeline. A pipeline with a durable step gets a journal entry first.

Example:

oxl✓ checked in CI
@error data Rejected { why: str }

fn moderate(n: i32) -> i32 | Rejected {
  if n % 2 == 1 { fail Rejected{ why: "odd" } }
  n
}

pipeline photo(n: i32) -> i32 {
  respond it
  -> moderate
  -> moderate
}

fn main() io, net, time, db {
  match photo(4) {
    i32 v => print("answer {v}")
    NetError e => print("net error")
  }
  sleep(100ms)
}
Output
answer 4
pub(api) fn pipeScope<T, effect F>(name: str, args: bytes, durable: bool, body: fn() -> T F) -> T | NetError  net, db, time, F

Since. 1.0.0-beta

Parameters

NameType
namestr
argsbytes
durablebool
bodyfn() -> T F

Returns

T

Errors

Effects

none declared (pure unless the body says otherwise)

Defined in: std/saga/saga.oxl:1489

See also