Timeout.select
commitd76c4648cb04caefa679f5a31bb1444f82208e05
authorGabe Levi <gabe@fb.com>
Fri, 12 Jan 2018 23:09:27 +0000 (12 15:09 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 16 Jan 2018 16:41:38 +0000 (16 08:41 -0800)
tree41fa516fac1b7fe11793eb4a20c2ab27cc202fdb
parent784aa9219516345b9a07d19d54e313b7fbe77554
Timeout.select

Summary:
There are two implementations of the `Timeout` module.

1. An implementation based on `Timer` (which is based on sigalrm) which works on Linux and OSX
2. An implementation where you need to manually check the timer which works on Windows

The manual checking is a pain. You basically need to create wrappers
around blocking I/O which makes sure to check the timeout.

This diff creates the wrapper around `Unix.select`, which allows us to
timeout `Unix.select` calls using the `Timeout` module.

Reviewed By: samwgoldman

Differential Revision: D6628750

fbshipit-source-id: 26c59f311cbff6f25adeb97222e19f31aeba9865
hphp/hack/src/utils/sys/timeout.ml
hphp/hack/src/utils/sys/timeout.mli