{"id":16068034,"url":"https://github.com/ged/ruby-zyre","last_synced_at":"2026-02-04T02:41:34.216Z","repository":{"id":65988037,"uuid":"309554295","full_name":"ged/ruby-zyre","owner":"ged","description":"A Ruby (MRI) binding for the Zyre library for reliable group messaging over local area networks, an implementation of the ZeroMQ Realtime Exchange protocol.","archived":false,"fork":false,"pushed_at":"2024-08-29T19:14:27.000Z","size":397,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-28T03:32:33.522Z","etag":null,"topics":["mesh-networks","networking","p2p","zeromq","zeromq-czmq"],"latest_commit_sha":null,"homepage":"https://gitlab.com/ravngroup/open-source/ruby-zyre","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ged.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-03T02:50:59.000Z","updated_at":"2021-11-28T23:26:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9f57d34-b288-419b-83f7-b0653e743016","html_url":"https://github.com/ged/ruby-zyre","commit_stats":{"total_commits":36,"total_committers":1,"mean_commits":36.0,"dds":0.0,"last_synced_commit":"7f4471851e0e846869eae962540df3bd375705fe"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ged/ruby-zyre","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ged%2Fruby-zyre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ged%2Fruby-zyre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ged%2Fruby-zyre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ged%2Fruby-zyre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ged","download_url":"https://codeload.github.com/ged/ruby-zyre/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ged%2Fruby-zyre/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265246212,"owners_count":23734109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["mesh-networks","networking","p2p","zeromq","zeromq-czmq"],"created_at":"2024-10-09T06:08:05.232Z","updated_at":"2026-02-04T02:41:34.167Z","avatar_url":"https://github.com/ged.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby Zyre\n\nhome\n: https://gitlab.com/ravngroup/open-source/ruby-zyre\n\ncode\n: https://gitlab.com/ravngroup/open-source/ruby-zyre/-/tree/master\n\ngithub\n: https://github.com/ged/ruby-zyre\n\ndocs\n: https://deveiate.org/code/zyre\n\n\n## Description\n\nA ZRE library for Ruby. This is a Ruby (MRI) binding for the Zyre library for\nreliable group messaging over local area networks, an implementation of [the ZeroMQ Realtime Exchange protocol][ZRE].\n\n\n### Examples\n\nZyre is a P2P library which has two modes: pub/sub and direct messaging. To use it, you create a node, optionally join some groups (subscribing), and start it. Then you can send broadcast messages to all other nodes in a group, or direct messages to a particular node.\n\nThis example joins the Zyre network and dumps messages it sees in the 'global' group to stderr:\n\n    node = Zyre::Node.new\n    node.join( 'global' )\n    node.start\n    \n    node.each_event do |event|\n      event.print\n    end\n\nTo send a direct message to a different node you need to know its `UUID`. There are number of ways to discover this:\n\n    # The UUIDs of all connected peers\n    node.peers\n    # The UUIDs of all the peers which have joined the `general` group\n    node.peers_by_group( 'general' )\n    # The UUID of the peer that sent the event\n    received_event.peer_uuid\n\nYou read events from the network with the Zyre::Node#recv method, but it blocks until an event arrives:\n\n    event = node.recv\n\nYou can also iterate over arriving events:\n\n    node.each do |event|\n        ...\n    end\n\nor use Zyre::Node#each as an Enumerator:\n\n    five_events = node.each_event.take( 5 )\n\nYou can also wait for a certain type of event:\n\n    event = node.wait_for( :SHOUT )\n\nand time out if it doesn't arrive within a certain length of time:\n\n    event = node.wait_for( :ENTER, timeout: 2.0 ) or\n        raise \"No one else on the network!\"\n\nYou can join a group with Zyre::Node#join:\n\n    node.join( 'alerts' )\n\nand you can detect other nodes joining one of your groups by looking for JOIN events (Zyre::Event::Join objects):\n\n    node.wait_for( :JOIN )\n\nYou can publish a message to all nodes in a group with Zyre::Node#shout:\n\n    node.shout( \"group1\", \"This is a message.\" )\n\nand read it:\n\n    event = other_node.recv\n    event.is_multipart?  # =\u003e false\n    event.msg            # =\u003e \"This is a message.\"\n    event.multipart_msg  # =\u003e [\"This is a message.\"]\n\n\nOr publish a message with multiple parts:\n\n    node.shout( \"group1\", 'message.type', \"This is a message.\" )\n\nand read it:\n\n    event = other_node.recv\n    event.is_multipart?  # =\u003e true\n    event.msg            # =\u003e \"message.type\"\n    event.multipart_msg  # =\u003e [\"message.type\", \"This is a message.\"]\n\n\n### To-Do\n\n* Implement the draft API methods on Zyre::Node\n* Hook up logging via `zsys_set_logsender`\n* Add richer matching to Zyre::Event#match.\n\n## Prerequisites\n\n* Ruby 2.7+\n* Zyre (https://github.com/zeromq/zyre)\n\n\n## Installation\n\n    $ gem install zyre\n\n\n## Contributing\n\nYou can check out the current development source with Mercurial via its\n[project page](https://gitlab.com/ravngroup/open-source/ruby-zyre).\n\nAfter checking out the source, run:\n\n    $ gem install -Ng\n    $ rake setup\n\nThis will install dependencies, and do any other necessary setup for\ndevelopment.\n\n\n## Authors\n\n- Michael Granger \u003cged@faeriemud.org\u003e\n\n\n## License\n\nCopyright (c) 2020, Ravn Group\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n* Neither the name of the author/s, nor the names of the project's\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n[ZRE]: https://rfc.zeromq.org/spec/36/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fged%2Fruby-zyre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fged%2Fruby-zyre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fged%2Fruby-zyre/lists"}