jaked / lwt-equeue

Run Lwt code on top of Ocamlnet's Equeue
10 stars 4 forks source link

Lwt 2.2 #2

Open hansole opened 13 years ago

hansole commented 13 years ago

Hi,

Lwt 2.2 has changed form select based to using libev. As part of this they seem to have dropped support for low level control of event loop in Lwt_main. Do you think this might result in that lwt-equeue will no longer work for newer versions of Lwt or is there other ways to still make it working?

Thanks,

Hans Ole

jaked commented 13 years ago

It won't work with Lwt 2.2.{0,1}, sorry. I emailed the ocsigen list about adding back support. Another possibility is to modify Lwt_unix. This would be relatively straightforward I think, since the libev interface is similar to Equeue. In the original lwt-equeue (based on Lwt 1.0) this is what I did, but it meant forking Lwt.

hansole commented 13 years ago

Guess going back to forking of Lwt will make it harder to keep up with Lwt. I saw that you mentioned that with the latest version of OCamlNet it could be possible to have equeue run on top of Lwt instead. I think this might be a better option, if they can not put back the old interface to Lwt, than forking of Lwt. Let us wait and see what the Lwt folks says.

hansole commented 13 years ago

I worked partly around this problem by creating my own Rpc_transport.rpc_multiplex_controller. This is constructed to have start_reading and start_writing call functions that can return a string or take a string as argument. These functions will then use Lwt for doing IO.

Seems like I still have to call Unixqueue.run to get the client to change from connecting to connected, but I don't think this involves any IO when it changes the state of an already connected sockets. The code seems to work OK, but there might be some corner cases that I'm not aware of.

I saw that they have fixed Lwt, so I guess this is not that useful. However, I need have access to the wire data for my application, so it's still useful independent of which event loop I can use. Seems like you can not upload attachment to comments, but I can send the example code in email if it is of interest.