Skip to content

Commit

Permalink
Refactor QueueExample to simplify consumer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
louthy committed Feb 14, 2025
1 parent 10766c6 commit 0cbd9b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Samples/EffectsExamples/Examples/QueueExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static Eff<RT, Unit> main()
// Run the queues in a forked task
// Repeatedly read from the console and write to one of the two queues depending on
// whether the first char is 1 or 2
var effect = from f in fork(Producer.merge(queues) | Consumer.repeat(writeLine))
var effect = from f in fork(Producer.merge(queues) | writeLine)
from x in Console<RT>.readLines | writeToQueue(queue1, queue2) | Schedule.Forever
from _ in f.Cancel // cancels the forked task
select unit;
Expand Down

0 comments on commit 0cbd9b7

Please sign in to comment.