Skip to content

Commit 17bf571

Browse files
committed
Add a delay to second example
1 parent 4ccd1c5 commit 17bf571

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tutorials/1ch.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ main = do
138138
-- Die immediately - throws a ProcessExitException with the given reason.
139139
Nothing -> die "nothing came back!"
140140
Just s -> say $ "got " ++ s ++ " back!"
141+
142+
-- Without the following delay, the process sometimes exits before the messages are exchanged.
143+
liftIO $ threadDelay 2000000
141144
{% endhighlight %}
142145

143146
Note that we've used `receiveWait` this time around to get a message.

0 commit comments

Comments
 (0)