OxL Reference

fn phop

on role in the tail of a pipeline (D-5110): a node with the role runs the step; a node without it hands the pipeline over. The value that enters the step is already in the journal (pdurable of the same step); the hand-over names the role in s/{id}/w and releases the lease, so a node with that role (its servePipe loop) claims the entry and resumes at this step. Without any live node that has the role the step stays local (nothing could ever run it).

Example:

oxl✓ checked in CI
use std.saga { phop, Handoff }

fn tail(v: i64) -> i64 | Handoff | Timeout io, net, db, time {
  match phop("gpu", v) {
    i64 x => x + 1
    Handoff h => h
    Timeout t => t
  }
}

fn main() io, net, db, time {
  print("{tail(1)!}")
}
Output
2
pub(api) fn phop<T: Serializable>(role: str, v: T) -> T | Handoff | Timeout  net, db, time

Since. 1.0.0-beta

Parameters

NameType
rolestr
vT

Returns

T

Errors

  • Handoff @error
  • Timeout @error
  • `Handoff` (not a failure; the tail continues elsewhere), `Timeout`.

Effects

net, db, time

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

See also