fn pdurable
A durable step: the value that enters step k is written to the journal first.
Example:
fn slow(n: i32) -> i32 time, io {
sleep(100ms)
n * 2
}
pipeline job(n: i32) -> i32 {
respond it
-> slow durable
}
fn main() io, net, time, db {
match job(5) {
i32 v => print("answer {v}")
NetError e => print("net error")
}
sleep(600ms)
print("active at the end: {std.saga.list(.Active).len()}")
}Output
answer 5 active at the end: 0
pub(api) fn pdurable<T: Serializable>(k: i64, label: str, v: T) -> T | Timeout net, db, timeSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
k | i64 |
label | str |
v | T |
Returns
T
Errors
Timeout@error- `Timeout` when the pipeline's journal entry was cancelled.
Effects
net, db, time
Defined in: std/saga/saga.oxl:1367