Skip to content

Commit

Permalink
Improve Luv.Loop.run return value docs
Browse files Browse the repository at this point in the history
Part of #54.
  • Loading branch information
aantron committed Mar 29, 2020
1 parent 97497de commit 66a01dc
Show file tree
Hide file tree
Showing 24 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let () =
end
end;
Luv.Loop.run () |> ignore
ignore (Luv.Loop.run () : bool)
```

<br/>
Expand Down
2 changes: 1 addition & 1 deletion example/cat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ let () =
Luv.File.read file [buffer] on_read
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/delay.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ let () =
print_endline "Hello, world!"));

print_endline "Waiting...";
ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/hello_world.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
let () =
print_endline "Hello, world!";
ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ let () =
(Option.get (Luv.Sockaddr.to_string (List.hd addr_infos).addr))
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/http_get.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ let () =
end
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/idle.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ let () =
ignore (Luv.Idle.stop idle)
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/onchange.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ let () =
end
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/pipe.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ let () =
print_string (Luv.Buffer.to_string buffer)
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/pipe_echo_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ let () =
end
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/pipe_hello_world.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ let () =
end
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/progress.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ let () =

Luv.Thread_pool.queue_work (fun () -> do_work 3 0) finished;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/readme.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ let () =
end
end;

Luv.Loop.run () |> ignore
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/send_signal.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ let () =

ignore (Luv.Process.kill child Luv.Signal.sigkill);

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/sigint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ let () =

print_endline "Type Ctrl+C to continue...";

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/spawn.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
let () =
ignore (Luv.Process.spawn "sleep" ["sleep"; "1"]);
ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/stdout.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ let () =
]
in
ignore (Luv.Process.spawn ~redirect "echo" ["echo"; "Hello,"; "world!"]);
ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/tcp_echo_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ let () =
end
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/tcp_hello_world.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ let () =
end
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/thread_pool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ let () =
print_endline "Finished")
ignore;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/udp_echo_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ let () =
Luv.UDP.send server [buffer] client_address ignore
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion example/udp_hello_world.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ let () =
Luv.Handle.close client ignore
end;

ignore (Luv.Loop.run ())
ignore (Luv.Loop.run () : bool)
2 changes: 1 addition & 1 deletion src/index.mld
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let () =
end
end;

Luv.Loop.run () |> ignore
ignore (Luv.Loop.run () : bool)
]}

This is the auto-generated API reference. For more conceptual information and
Expand Down
3 changes: 3 additions & 0 deletions src/loop.mli
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ val run : ?loop:t -> ?mode:Run_mode.t -> unit -> bool
meaning of the constants that can be specified with [?mode]. The default
value is [`DEFAULT].
Again, see {{:http://docs.libuv.org/en/v1.x/loop.html#c.uv_run} [uv_run]}
for information on the return value.
This function typically should not be called by a library based on Luv.
Rather, it should be called by applications. *)

Expand Down

0 comments on commit 66a01dc

Please sign in to comment.