Add support for selecting the libev backend#269
Add support for selecting the libev backend#269yallop wants to merge 2 commits intoocsigen:masterfrom
Conversation
|
Thanks, looks good. I have no strong objection to making the type abstract, but why not just expose a (maybe polymorphic) variant, and type the argument to I've fixed the problem with the CI builds, in |
c6d78f0 to
c0c8597
Compare
That's a reasonable way to do things, too. There are a couple of reasons why I prefer to use an abstract type:
That said, I don't mind switching to a list, if you prefer. Or, since the abstract interface is compatible with lists, there's always the option of switching later if you're happy to merge this as is. |
| val devpoll : t | ||
| val port : t | ||
| end | ||
|
|
There was a problem hiding this comment.
It would be convenient to have a pp function here to have a human-readable representation of the abstract type, for logging purposes.
4a60522 to
ffdb93f
Compare
268bc37 to
55e9817
Compare
|
Merged with trivial changes in #294. Thanks! |
This pull request adds support for selecting the backend (
poll,select,kqueue, etc.) used by the libev engine. (The libev man page has some fairly forthright notes about the tradeoffs between the various backends.)The backends are exposed as members of an abstract type,
Ev_backend.tin the Lwt engine module:Keeping the type abstract leaves open the possibility to extend the interface in a backwards-compatible way in the future. For example, it is sometimes useful to pass multiple backend flags, leaving libev to select the best backend from those available; this could be supported in Lwt by the addition of a function of type
Ev_backend.t -> Ev_backend.t -> Ev_backend.t. For the moment there is only support for passing a single backend.The backend is passed as an argument to the
libevclass:The addition of arguments to
libevis a backwards incompatible change, and client code must be changed to add a unit argument:new libevHowever, this is a one-time cost: if the
libevinterface is extended with additional optional flags in the future, no further changes to client code will be needed.