LLeandro Osteradocs: begin tutorial
cad941f3创建于 2023年11月21日历史提交
文件最后提交记录最后更新时间
docs: begin tutorial 2 年前
docs: begin tutorial 2 年前
docs: begin tutorial 2 年前
README.md

1-hello-world

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)

Next Steps