You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZeroMQ is a message-oriented socket system that supports many communication styles (request/reply, , &c.) on top of many transport layers (intra-process, inter-process, inter-machine via tcp, &c.) with bindings to many languages.
63
+
ZeroMQ is a message-oriented socket system that supports many communication styles (request/reply, pub-sub, etc.) on top of many transport layers (intra-process, inter-process, inter-machine via tcp, etc.) with bindings to many languages.
63
64
ZeroMQ sockets are a great substrate upon which to build service-oriented architectures.
64
-
ZeroMQ sockets have less overhead than HTTP and are architecturally more flexible---supporting publish/subscribe, fan-out, and other topologies in addition to request/reply.
65
+
ZeroMQ sockets have less overhead than HTTP and are architecturally more flexible -- supporting publish/subscribe, fan-out, and other topologies in addition to request/reply.
65
66
66
-
However, ZeroMQ sockets are not threadsafe---concurrent usage typically requires explicit locking or dedicated threads and queues.
67
-
The zmq-async library handles all of that for you, creating ZeroMQ socket on your behalf and giving you access to them via threadsafe core.async channels.
67
+
However, ZeroMQ sockets are not thread-safe -- concurrent usage typically requires explicit locking or dedicated threads and queues.
68
+
The zmq-async library handles all of that for you, creating ZeroMQ sockets on your behalf and giving you access to them via thread-safe core.async channels.
68
69
69
-
The zmq-async library provides one function, `register-socket!`, which associates a ZeroMQ socket with core.async channel(s) `in` (into which you can write strings or byte arrays) and/or `out` (whence byte arrays).
70
-
Writing a Clojure collection of strings and/or byte arrays sends a multipart message; received multipart messages are put on core.async channels as a vector of byte arrays.
70
+
The zmq-async library provides one function, `register-socket!`, which associates a ZeroMQ socket with core.async channel(s) `in` (into which you can write strings or byte arrays) and/or `out` (from which you can read byte arrays).
71
+
Writing a Clojure collection of strings and/or byte arrays sends a multipart message. Received multipart messages are put on core.async channels as a vector of byte arrays.
71
72
72
-
The `register-socket!` function can be given an alreadycreated ZeroMQ socket, but typically you would have the library create a socket for you by passing the `socket-type` and a `configurator`.
73
+
The `register-socket!` function can be given an already-created ZeroMQ socket, but typically you would have the library create a socket for you by passing the `socket-type` and a `configurator`.
73
74
The configurator is a function that is passed the raw ZeroMQ socket object.
74
-
This function is run on the socket after it is created to connect/bind addresses, set pubsub subscriptions, and otherwise configure the socket.
75
+
This function is run on the socket after it is created in order to connect/bind addresses, set pub-sub subscriptions, and otherwise configure the socket.
75
76
76
77
WARNING: The implicit context supporting `register-socket!` can only handle one incoming/outgoing message at a time.
77
78
If you need sockets to work in parallel (i.e., you don't want to miss a small control message just because you're slurping in a 10GB message on another socket), then you'll need multiple zmq-async contexts.
0 commit comments