Reply message does not need to happen in the block, continuation can be saved.
function Hello() {
print('hello')
world := World{}
say1 := world.say1{}
say2 := world.say2{}
}
function World() {
tasks := Task<string>[]{}
await {
say1(): String {
tasks.push(say1)
}}
await {
say2(): String {
tasks.push(say2)
}}
for (var task of tasks) {
'world' -> task
}
}
For one function call, there is a "Result" object on the caller side, and a "Task" object on the callee side. You can use <- to get value from Result, and use -> to rely result of task.
The definition of Result is
interface ResultObserver {
Observed(result: Result)
}
interface Result {
T: type
Value(): T
Finished(): bool
AddObserver(observer: ResultObserver)
}
Single actor
One actor blocking call another actor
One actor start then wait another actor
One actor A start another actor B, A blocking call B's method
Start actor from method
Wait for multiple actors, any one finishes, the wait unblocks
Wait for request and response at same time
Reply message does not need to happen in the block, continuation can be saved.
For one function call, there is a "Result" object on the caller side, and a "Task" object on the callee side. You can use
<-
to get value from Result, and use->
to rely result of task.The definition of
Result
isThe definition of
Task
is