We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
awaitAll
awaitAny
ForkIO
The existing IO.awaitAll and IO.awaitAny all work with either IO<ForkIO<A>> or K<M, ForkIO<A>>. So, this works:
IO.awaitAll
IO.awaitAny
IO<ForkIO<A>>
K<M, ForkIO<A>>
IO<A> op = ...; var fa = op.Fork(); var fb = op.Fork(); var fc = op.Fork(); var result = IO.awaitAll(fa, fb, fc);
But, this doesn't:
var result = from fa in op.Fork() from fb in op.Fork() from fc in op.Fork() from _ in awaitAll(fa, fb, fc) select unit;
So, we need awaitAll and awaitAny that take raw ForkIO values, not just IO<ForkIO<A>> values.
Use the .Await property of the ForkIO an then monad-chain the forks:
.Await
var result = from fa in op.Fork() from fb in op.Fork() from fc in op.Fork() from _ in fa.Await >> fb.Await >> fc.Await select unit;
That will wait for fa, fb, and fc to complete before continuing.
fa
fb
fc
The text was updated successfully, but these errors were encountered:
louthy
No branches or pull requests
The existing
IO.awaitAll
andIO.awaitAny
all work with eitherIO<ForkIO<A>>
orK<M, ForkIO<A>>
. So, this works:But, this doesn't:
So, we need
awaitAll
andawaitAny
that take rawForkIO
values, not justIO<ForkIO<A>>
values.awaitAll
workaroundUse the
.Await
property of theForkIO
an then monad-chain the forks:That will wait for
fa
,fb
, andfc
to complete before continuing.The text was updated successfully, but these errors were encountered: