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)
}Вывод
1
pub(api) fn servePipe<effect F>(name: str, roles: str, resume: fn(i64, bytes, bytes) -> () F) net, db, time, FПотокобезопасность. the loop runs in a task of the node.
С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
name | str |
roles | str |
resume | fn(i64, bytes, bytes) -> () F |
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/saga/saga.oxl:1665