Skip to content

Commit 8bb7d7f

Browse files
authored
prelude: don't set Lwt_engine to poll if libev is available (#52)
1 parent ff6002d commit 8bb7d7f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

prelude.ml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,12 @@ let call_me_maybe f x =
5555
| None -> ()
5656
| Some f -> f x
5757

58+
(*
59+
If libev backend is available, do nothing (lwt uses it as default).
60+
Otherwise, prefer poll over select, because select can only monitor fds up to 1024,
61+
and poll is guaranteed to be available without the fd limitation.
62+
*)
5863
let () =
59-
Lwt_engine.set @@ new Lwt_engines.poll
64+
if not (Lwt_config._HAVE_LIBEV && Lwt_config.libev_default) then begin
65+
Lwt_engine.set @@ new Lwt_engines.poll
66+
end

0 commit comments

Comments
 (0)