A project so basic that fits on a single line!
Riot.run @@ fun () -> print_endline "Hello, Joe!"
Every Riot program begins with a call to Riot.run
. Riot.run
takes a single
function as input, and does not terminate. This is because Riot programs are
expected to run forever.
If you want to terminate the Riot runtime, you can call Riot.shutdown ()
from
anywhere in the program. Keep in mind that this will not await for all
processes to terminate. We will cover graceful-shutdowns of applications later
in this tutorial.
Riot.run @@ fun () ->
print_endline "Hello, Joe!";
Riot.shutdown ()
The smallest Riot program, that starts and ends immediately, is then:
Riot.(run shutdown)
- the next step introduces you to Processes