You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to support multithreaded continuations in the form of:
let flowvar =spawnfoo(a,b,c)
flowvar.then(bar(x, _, z))
let r =sync flowvar
Syntax to be ironed out.
The _ is a placeholder for the result of the first spawn to be passed to bar reusing the convention from dupnim-lang/Nim#14405.
In terms of low-level, continuations can just be a syntax wrapper on top of the FlowEvent machinery.
The "tricky" part is swapping the spawned FlowVar to the continuation flowvar but we might just require those to be mutable and disallow continuations on let Flowvar.
The text was updated successfully, but these errors were encountered:
Actually we probably need a sink to allow chaining, and so the continuation is returned in a new variable.
let flowvar =spawnfoo(a,b,c)
let continued = flowvar.then(bar(x, _, z).then(baz(_))
# flowvar is now invalid and we need enforcing at compile-time# by disallowing `=`
alternatively (or both), we copy dup semantics in a continueWith macro
let flowvar =spawnfoo(a,b,c)
let continued = flowvar.continueWith:
bar(x, _, z)
baz(_)
Motivation
It would be nice to support multithreaded continuations in the form of:
Syntax to be ironed out.
The
_
is a placeholder for the result of the first spawn to be passed tobar
reusing the convention fromdup
nim-lang/Nim#14405.In terms of low-level, continuations can just be a syntax wrapper on top of the
FlowEvent
machinery.The "tricky" part is swapping the spawned FlowVar to the continuation flowvar but we might just require those to be mutable and disallow continuations on
let
Flowvar.The text was updated successfully, but these errors were encountered: