fn respondThen
Answers the caller with v and runs tail(v) in the background scope of the node.
Example:
fn after(n: i32) -> i32 time, io {
sleep(100ms)
print("tail got {n}")
n
}
pipeline job(n: i32) -> i32 {
respond it
-> after
}
fn main() io, net, time, db {
match job(5) {
i32 v => print("answer {v}")
NetError e => print("net error")
}
sleep(400ms)
}Вывод
answer 5 tail got 5
pub(api) fn respondThen<V: Serializable, effect F>(v: V, tail: fn(V) -> () F) -> V net, db, time, FС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
v | V |
tail | fn(V) -> () F |
Возвращает
V net, db, time, F
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/saga/saga.oxl:1419