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()}")
}Вывод
answer 5 active at the end: 0
pub(api) fn pdurable<T: Serializable>(k: i64, label: str, v: T) -> T | Timeout net, db, timeС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
k | i64 |
label | str |
v | T |
Возвращает
T
Ошибки
Timeout@error- `Timeout` when the pipeline's journal entry was cancelled.
Эффекты
net, db, time
Определено в: std/saga/saga.oxl:1381