Open
Description
@timohanke provided this feedback
let fut1 = Actor1.call(); // the slow (e.g. inter-subnet) call
let fut2 = Actor2.call(); // the fast one
await fut1;
// state changes
await fut2;
in this scenario if the fut2
response arrives before fut1
's, it gets saved while await fut1
is still blocking. When we come to await fut2
the continuation is not invoked immediately, because of the mandatory commit semantics enforcing a context switch.
Timo proposes an opt-in mechanism to avoid the commit and immediately go on executing the continuation, thus avoiding the delay.
I propose a parenthetical like
(with commit = false) await fut2;
to opt out of await
's mandatory blocking.
The other possibility is a parallel await
let vals = [await] [fut1, fut2];
@Kamirus suggests
let val = switch (fulfilled fut2) {
case (?val) val;
case null await fut2
}
Metadata
Metadata
Assignees
Labels
No labels