Skip to content

Commit

Permalink
fix: update example 4 to use receive_any (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmmulroy authored Jul 16, 2024
1 parent 3a9c100 commit 67dcb45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/4-long-lived-processes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ someone, and continues awaiting.

```ocaml
let rec loop () =
(match receive () with
(match receive_any () with
| Hello name -> print_endline ("Hello, " ^ name ^ "! :D")
| _ -> print_endline "Oh no, an unhandled message! D:");
loop ()
Expand All @@ -37,7 +37,7 @@ One caveat is that because function application can't be interrupted, we need
to make sure we _yield_ control back to the scheduler at some point before
recursing. Otherwise one of the cores will be _blocked_ by this process until it yields.

In our example, this is done automatically when we call `receive`
In our example, this is done automatically when we call `receive_any`

In fact, we are strategically placing yields all through the standard library
to make it as seamless as possible to write Riot programs without thinking
Expand Down

0 comments on commit 67dcb45

Please sign in to comment.