OxL Reference

fn respondThen

Answers the caller with v and runs tail(v) in the background scope of the node.

Example:

oxl✓ checked in CI
fn after(n: i32) -> i32 time, io {
  sleep(100ms)
  print("tail got {n}")
  n
}

pipeline job(n: i32) -> i32 {
  respond it
  -> after
}

fn main() io, net, time, db {
  match job(5) {
    i32 v => print("answer {v}")
    NetError e => print("net error")
  }
  sleep(400ms)
}
Output
answer 5
tail got 5
pub(api) fn respondThen<V: Serializable, effect F>(v: V, tail: fn(V) -> () F) -> V  net, db, time, F

Since. 1.0.0-beta

Parameters

NameType
vV
tailfn(V) -> () F

Returns

V net, db, time, F

Effects

none declared (pure unless the body says otherwise)

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

See also