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
`gem install omq` — that's it. No libzmq, no compiler, no system packages. Just Ruby.
9
-
10
-
OMQ builds ZeroMQ socket patterns on top of [protocol-zmtp](https://github.com/paddor/protocol-zmtp) (a pure Ruby [ZMTP 3.1](https://rfc.zeromq.org/spec/23/) codec) using [Async](https://github.com/socketry/async) fibers. It speaks native ZeroMQ on the wire and interoperates with libzmq, pyzmq, CZMQ, and everything else in the ZMQ ecosystem.
> Ruby 4.0 + YJIT on a Linux VM — see [`bench/`](bench/) for full results
17
13
18
-
---
19
-
20
-
## What is ZeroMQ?
21
-
22
-
Brokerless message-oriented middleware. No central server, no extra hop — processes talk directly to each other, cutting latency in half compared to broker-based systems. You get the patterns you'd normally build on top of RabbitMQ or Redis — pub/sub, work distribution, request/reply, fan-out — but decentralized, with no single point of failure.
23
-
24
-
Networking is hard. ZeroMQ abstracts away reconnection, queuing, load balancing, and framing so you can focus on what your system actually does. Start with threads talking over `inproc://`, split into processes with `ipc://`, scale across machines with `tcp://` — same code, same API, just change the URL.
14
+
`gem install omq` and you're done. No libzmq, no compiler, no system packages — just Ruby talking to every other ZeroMQ peer out there.
25
15
26
-
If you've ever wired up services with raw TCP, HTTP polling, or Redis pub/sub and wished it was simpler, this is what you've been looking for.
16
+
ØMQ gives your Ruby processes a way to talk to each other — and to anything else speaking ZeroMQ — without a broker in the middle. Same API whether they live in the same process, on the same machine, or across the network. Reconnects, queuing, and back-pressure are handled for you; you write the interesting part.
27
17
28
-
See [GETTING_STARTED.md](GETTING_STARTED.md)for a ~30 min walkthrough of all major patterns with working code.
18
+
New to ZeroMQ? Start with [GETTING_STARTED.md](GETTING_STARTED.md)— a ~30 min walkthrough of every major pattern with working code.
29
19
30
20
## Highlights
31
21
32
22
-**Zero dependencies on C** — no extensions, no FFI, no libzmq. `gem install` just works everywhere
33
-
-**Fast** — YJIT-optimized hot paths, batched sends, GC-tuned allocations, buffered I/O via [io-stream](https://github.com/socketry/io-stream), direct-pipe inproc bypass.
34
-
-**[`omq` CLI](https://github.com/paddor/omq-cli)** — `gem install omq-cli` for a command-line tool with Ruby eval, Ractor parallelism, and script handlers
23
+
-**Fast** — YJIT-optimized hot paths, batched sends, GC-tuned allocations, buffered I/O via [io-stream](https://github.com/socketry/io-stream), direct-pipe inproc bypass
24
+
-**[`omq` CLI](https://github.com/paddor/omq-cli)** — a powerful swiss army knife for ØMQ. `gem install omq-cli`
35
25
-**Every socket pattern** — req/rep, pub/sub, push/pull, dealer/router, xpub/xsub, pair, and all draft types
-**Async-native** — built on fibers, non-blocking from the ground up. A shared IO thread handles sockets outside of Async — no reactor needed for simple scripts
38
-
-**Wire-compatible** — interoperates with libzmq, pyzmq, CZMQ over tcp and ipc
27
+
-**Async-native** — built on fibers, non-blocking from the ground up
28
+
-**Works outside Async too** — a shared IO thread handles sockets for callers that aren't inside a reactor, so simple scripts just work
29
+
-**Wire-compatible** — interoperates with libzmq, pyzmq, CZMQ, zmq.rs over tcp and ipc
39
30
-**Bind/connect order doesn't matter** — connect before bind, bind before connect, peers come and go. ZeroMQ reconnects automatically and queued messages drain when peers arrive
40
31
41
32
For architecture internals, see [DESIGN.md](DESIGN.md).
@@ -164,15 +155,15 @@ All sockets are thread-safe. Default HWM is 1000 messages per socket. `max_messa
164
155
165
156
#### Draft (single-frame only)
166
157
167
-
These require the `omq-draft`gem.
158
+
Each draft pattern lives in its own gem — install only the ones you use.
@@ -192,6 +183,12 @@ See the [omq-cli README](https://github.com/paddor/omq-cli) for full documentati
192
183
-**[omq-ffi](https://github.com/paddor/omq-ffi)** — libzmq FFI backend. Same OMQ socket API, but backed by libzmq instead of the pure Ruby ZMTP stack. Useful for interop testing and when you need libzmq-specific features. Requires libzmq installed.
193
184
-**[omq-ractor](https://github.com/paddor/omq-ractor)** — bridge OMQ sockets into Ruby Ractors for true parallel processing across cores. I/O stays on the main Ractor, worker Ractors do pure computation.
194
185
186
+
### Protocol extensions (RFCs)
187
+
188
+
Optional plug-ins that extend the ZMTP wire protocol. Each is a separate gem; load the ones you need.
189
+
190
+
-**[omq-rfc-zstd](https://github.com/paddor/omq-rfc-zstd)** — transparent Zstandard compression on the wire, negotiated per peer via READY properties.
191
+
195
192
## Development
196
193
197
194
```sh
@@ -210,16 +207,16 @@ the stack.
210
207
# clone OMQ and its sibling repos into the same parent directory
0 commit comments