jaked / lwt-equeue Goto Github PK
View Code? Open in Web Editor NEWRun Lwt code on top of Ocamlnet's Equeue
Run Lwt code on top of Ocamlnet's Equeue
Seems like the current version of lwt-equeue does not run threads at top of ocamlnet
This program works at older version 0.2.1 of orpc but not with the trunk of lwt-equeue. (Note that the old version is also using ocaml 3.11.1 and the new version is running using 3.12, but I guess that is not the cause of the problem):
open Lwt
let rec do_something () =
Lwt_unix.sleep 1.0 >>= fun _ ->
Printf.printf "*%!";
do_something ()
let esys = Unixqueue.create_unix_event_system ();;
let _ =
Lwt_equeue.set_event_system esys;
ignore(do_something ());
Unixqueue.run esys;
;;
I'm able to run Lwt threads that are linked agains lwt-equeue with the latest version by running them as lwt thread:
open Lwt
let rec do_something () =
Lwt_unix.sleep 1.0 >>= fun _ ->
Printf.printf "*%!";
do_something ()
let esys = Unixqueue.create_unix_event_system ();;
let _ =
Lwt_equeue.set_event_system esys;
Lwt_unix.run (do_something ());
;;
And this can be done without creating or setting the event system, so I guess they are run fully outside ocamlnet.
tags:
<.ml_> : pkg_lwt-equeue
<*.byte> : pkg_lwt-equeue
Also I got a problem when compiling lwt-equeue the first time. It wants to compile cohttpserver-netplex that is dependent on lwt-equeue which is not yet installed.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.