I recently worked on the ordma package and needed to implement a new Lwt engine, based on librdmacm's rselect. There were some problems:
- Lwt checks for readability (
Lwt_unix.readable) on a Lwt.file_descr on the side using a separate call to poll here, iso going through the engine. This breaks down if the resource represented by this Lwt.file_descr is not a resource that can be poll-ed (in this case an rsocket).
Lwt.file.descr has some internal state (the state attribute )that cannot be manipulated through the interface. This forced me into using a private copy the definition, and a "cast" via Obj.magic,
which is really ugly. A typical example is the close call.
Basically, what I'm saying is that there is an API to plug in your own lwt engine, but that it doesn't really work when you actually try to do this (or I wasn't smart enough to figure out how to do this cleanly).
I recently worked on the ordma package and needed to implement a new Lwt engine, based on librdmacm's rselect. There were some problems:
Lwt_unix.readable) on aLwt.file_descron the side using a separate call to poll here, iso going through the engine. This breaks down if the resource represented by thisLwt.file_descris not a resource that can bepoll-ed (in this case an rsocket).Lwt.file.descrhas some internal state (the state attribute )that cannot be manipulated through the interface. This forced me into using a private copy the definition, and a "cast" viaObj.magic,which is really ugly. A typical example is the close call.
Basically, what I'm saying is that there is an API to plug in your own lwt engine, but that it doesn't really work when you actually try to do this (or I wasn't smart enough to figure out how to do this cleanly).