rgrinberg / async-zmq Goto Github PK
View Code? Open in Web Editor NEWAsync wrapper around ocaml-zmq
Async wrapper around ocaml-zmq
#=== ERROR while compiling async-zmq.0.3.0 ====================================#
# context 2.0.0~rc | linux/x86_64 | ocaml-system.4.05.0 | file:///home/akochkov/data/tmp/opam-repository
# path ~/.opam/default/.opam-switch/build/async-zmq.0.3.0
# command ~/.opam/default/bin/omake
# exit-code 2
# env-file ~/.opam/log/async-zmq-8146-bc27ca.env
# output-file ~/.opam/log/async-zmq-8146-bc27ca.out
### output ###
# [...]
# *** omake: finished reading OMakefiles (0.03 sec)
# --- Checking if ocamldep understands -modules... (yes)
# - scan lib scan-ocaml-async_zmq.mli
# + ocamlfind ocamldep -package ZMQ,threads,core,async,sexplib,ppx_sexp_conv,ppx_deriving -modules async_zmq.mli
# | Shell.ocamldep-postproc()
# File "async_zmq.mli", line 9, characters 24-31:
# Error: Cannot locate deriver sexp_of
# *** omake: 14/27 targets are up to date
# *** omake: failed (0.14 sec, 1/1 scans, 0/0 rules, 7/69 digests)
# *** omake: targets were not rebuilt because of errors:
# <scanner lib/scan-ocaml-async_zmq.mli>
# depends on: lib/async_zmq.mli
=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
┌─ The following actions failed
│ λ build async-zmq 0.3.0
When using recv
, CPU usage jumps to 100% until a message arrives. A reproducible testcase is the rep
sample.
I'm getting this error.
Here's a sscce:
open Core.Std
open Async.Std
module AZMQ = Async_zmq.Socket
let test () =
let z = ZMQ.Context.create () in
let socket = ZMQ.Socket.create z ZMQ.Socket.req in
ZMQ.Socket.connect socket "tcp://127.0.0.1:5555";
let sock = AZMQ.of_socket socket in
ZMQ.Socket.close socket;
ZMQ.Context.terminate z
let () =
test ();
test ()
Here's the full exception:
Uncaught exception:
( "Error in Async.Fd_by_descr.add_exn: attempt to register a file descriptor with async\
\nthat async believes it is already managing. This likely indicates either:\
\n\
\n * a bug in async\
\n * code outside of async manipulating a file descriptor that async is managing\
\n"
(((file_descr 8) (info <zmq>) (kind (Socket Bound))
(supports_nonblock false) (have_set_nonblock false) (state (Open Empty))
(watching ((read Not_watching) (write Not_watching)))
(watching_has_changed false) (num_active_syscalls 0)
(close_finished Empty))
((num_keys 8192)
(alist
((8
((file_descr 8) (info <zmq>) (kind (Socket Bound))
(supports_nonblock false) (have_set_nonblock false)
(state (Open Empty))
(watching ((read Not_watching) (write Not_watching)))
(watching_has_changed false) (num_active_syscalls 0)
(close_finished Empty)))
(11
((file_descr 11) (info interruptor_pipe_write) (kind Fifo)
(supports_nonblock true) (have_set_nonblock false)
(state (Open Empty))
(watching ((read Not_watching) (write Not_watching)))
(watching_has_changed false) (num_active_syscalls 0)
(close_finished Empty)))
(10
((file_descr 10) (info interruptor_pipe_read) (kind Fifo)
(supports_nonblock true) (have_set_nonblock false)
(state (Open Empty))
(watching ((read Not_watching) (write Not_watching)))
(watching_has_changed false) (num_active_syscalls 0)
(close_finished Empty))))))))
Raised at file "src/error.ml", line 7, characters 21-29
Called from file "src/raw_scheduler.ml", line 140, characters 2-38
Called from file "test.ml", line 11, characters 13-34
Called from file "test.ml", line 17, characters 2-9
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.