fn servePipe
Registers the recovery loop of a pipeline with durable steps: resume(step, args, value) runs the pipeline from that step.
Example:
fn slow(n: i32) -> i32 time, io {
sleep(100ms)
n + 1
}
pipeline job(n: i32) -> i32 {
respond it
-> slow durable
}
fn main() io, net, time, db {
// servePipe("main.job", ...) is registered by the generated code; the call only starts the pipeline
print("{job(1)!}")
sleep(500ms)
}Output
1
pub(api) fn servePipe<effect F>(name: str, roles: str, resume: fn(i64, bytes, bytes) -> () F) net, db, time, FThread safety. the loop runs in a task of the node.
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
name | str |
roles | str |
resume | fn(i64, bytes, bytes) -> () F |
Effects
none declared (pure unless the body says otherwise)
Defined in: std/saga/saga.oxl:1665