{"id":18234653,"url":"https://github.com/paddor/cztop","last_synced_at":"2026-04-01T18:49:01.458Z","repository":{"id":62556630,"uuid":"42690308","full_name":"paddor/cztop","owner":"paddor","description":"Minimal, modern Ruby binding for ZeroMQ — brokerless messaging with CURVE encryption, pattern-based sockets, and sub-ms latency","archived":false,"fork":false,"pushed_at":"2026-03-31T18:06:29.000Z","size":1139,"stargazers_count":39,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-03-31T18:34:33.921Z","etag":null,"topics":["async","czmq","czmq-binding","ffi-bindings","ruby","zeromq","zmq"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paddor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-09-18T00:35:50.000Z","updated_at":"2026-03-31T18:06:32.000Z","dependencies_parsed_at":"2024-01-11T23:41:38.360Z","dependency_job_id":"08fbfc2d-5d87-40bd-ab99-24d69efe9ddf","html_url":"https://github.com/paddor/cztop","commit_stats":{"total_commits":835,"total_committers":6,"mean_commits":"139.16666666666666","dds":"0.15449101796407183","last_synced_commit":"562d873db8872f1f581faec472cbad82a3385a1c"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/paddor/cztop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paddor%2Fcztop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paddor%2Fcztop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paddor%2Fcztop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paddor%2Fcztop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paddor","download_url":"https://codeload.github.com/paddor/cztop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paddor%2Fcztop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","czmq","czmq-binding","ffi-bindings","ruby","zeromq","zmq"],"created_at":"2024-11-04T23:05:03.197Z","updated_at":"2026-04-01T18:49:01.448Z","avatar_url":"https://github.com/paddor.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CZTop\n\n[![CI](https://github.com/paddor/cztop/actions/workflows/ci.yml/badge.svg)](https://github.com/paddor/cztop/actions/workflows/ci.yml)\n[![Gem Version](https://img.shields.io/gem/v/cztop?color=e9573f)](https://rubygems.org/gems/cztop)\n[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](LICENSE)\n[![Ruby](https://img.shields.io/badge/Ruby-%3E%3D%203.3-CC342D?logo=ruby\u0026logoColor=white)](https://www.ruby-lang.org)\n\nRuby FFI binding for [CZMQ](http://czmq.zeromq.org/) / [ZeroMQ](https://zeromq.org/) — high-performance asynchronous messaging for distributed systems.\n\n\u003e **353k msg/s** inproc throughput | **49 µs** fiber roundtrip latency | nonblock fast path\n\n---\n\n## Highlights\n\n- **All socket types** — req/rep, pub/sub, push/pull, dealer/router, xpub/xsub, pair, stream\n- **Async-first** — first-class [async](https://github.com/socketry/async) fiber support, also works with plain threads\n- **Ruby-idiomatic API** — messages as `Array\u003cString\u003e`, errors as exceptions, timeouts as `IO::TimeoutError`\n\n## Install\n\nInstall CZMQ on your system:\n\n```sh\n# Debian/Ubuntu\nsudo apt install libczmq-dev\n\n# macOS\nbrew install czmq\n```\n\nThen add the gem:\n\n```sh\ngem install cztop\n# or in Gemfile\ngem 'cztop'\n```\n\n## Learning ZeroMQ\n\nNew to ZeroMQ? See [ZGUIDE_SUMMARY.md](ZGUIDE_SUMMARY.md) — a ~30 min read covering all major patterns with working CZTop code examples.\n\n## Quick Start\n\n### Request / Reply\n\n```ruby\nrequire 'cztop'\nrequire 'async'\n\nAsync do |task|\n  rep = CZTop::Socket::REP.new('inproc://example')\n  req = CZTop::Socket::REQ.new('inproc://example')\n\n  task.async do\n    msg = rep.receive\n    rep \u003c\u003c msg.map(\u0026:upcase)\n  end\n\n  req \u003c\u003c 'hello'\n  puts req.receive.inspect  # =\u003e [\"HELLO\"]\nend\n```\n\n### Pub / Sub\n\n```ruby\nAsync do |task|\n  pub = CZTop::Socket::PUB.new('inproc://pubsub')\n  sub = CZTop::Socket::SUB.new('inproc://pubsub')\n  sub.subscribe('')  # subscribe to all\n\n  sleep 0.01  # allow connection to establish\n\n  task.async { pub \u003c\u003c 'news flash' }\n  puts sub.receive.inspect  # =\u003e [\"news flash\"]\nend\n```\n\n### Push / Pull (Pipeline)\n\n```ruby\nAsync do\n  push = CZTop::Socket::PUSH.new('inproc://pipeline')\n  pull = CZTop::Socket::PULL.new('inproc://pipeline')\n\n  push \u003c\u003c 'work item'\n  puts pull.receive.inspect  # =\u003e [\"work item\"]\nend\n```\n\n## Socket Types\n\n| Pattern | Classes | Direction |\n|---------|---------|-----------|\n| Request/Reply | `REQ`, `REP` | bidirectional |\n| Publish/Subscribe | `PUB`, `SUB`, `XPUB`, `XSUB` | unidirectional |\n| Pipeline | `PUSH`, `PULL` | unidirectional |\n| Routing | `DEALER`, `ROUTER` | bidirectional |\n| Exclusive pair | `PAIR` | bidirectional |\n| Raw TCP | `STREAM` | bidirectional |\n\nAll classes live under `CZTop::Socket::`.\n\n## Performance\n\nBenchmarked with benchmark-ips on Linux x86_64 (CZMQ 4.2.1, ZMQ 4.3.5, Ruby 4.0.1 +YJIT):\n\n#### Throughput (push/pull)\n\n| | inproc | ipc | tcp |\n|---|--------|-----|-----|\n| **Async** | 284k/s | 17k/s | 14k/s |\n| **Threads** | 353k/s | 25k/s | 21k/s |\n\n#### Latency (req/rep roundtrip)\n\n| | inproc | ipc | tcp |\n|---|--------|-----|-----|\n| **Async** | 49 µs | 100 µs | 107 µs |\n| **Threads** | 113 µs | 154 µs | 168 µs |\n\nAsync fibers deliver 2.3x lower inproc latency thanks to cheap context switching. See [`bench/`](bench/) for full results and scripts.\n\n## API Reference\n\nFull [API documentation](http://www.rubydoc.info/gems/cztop).\n\n## Development\n\n```sh\nbundle install\nbundle exec rake\n```\n\n## License\n\n[ISC](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaddor%2Fcztop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaddor%2Fcztop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaddor%2Fcztop/lists"}