{"id":19973280,"url":"https://github.com/zeromq/mruby-zmq","last_synced_at":"2025-05-04T02:31:55.089Z","repository":{"id":47274134,"uuid":"77738843","full_name":"zeromq/mruby-zmq","owner":"zeromq","description":"mruby bindings for libzmq (v4)","archived":false,"fork":false,"pushed_at":"2025-01-18T16:38:26.000Z","size":343,"stargazers_count":11,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-08T01:38:01.304Z","etag":null,"topics":["libzmq","mruby","mruby-bindings","zeromq","zeromq-library"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeromq.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-31T12:11:39.000Z","updated_at":"2025-01-18T16:38:28.000Z","dependencies_parsed_at":"2024-04-01T22:30:37.732Z","dependency_job_id":"5fb0a1d0-450c-4f53-bd15-b820dec6f29d","html_url":"https://github.com/zeromq/mruby-zmq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Fmruby-zmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Fmruby-zmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Fmruby-zmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Fmruby-zmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeromq","download_url":"https://codeload.github.com/zeromq/mruby-zmq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252278971,"owners_count":21722797,"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":["libzmq","mruby","mruby-bindings","zeromq","zeromq-library"],"created_at":"2024-11-13T03:10:53.253Z","updated_at":"2025-05-04T02:31:54.658Z","avatar_url":"https://github.com/zeromq.png","language":"C","readme":"# mruby-zmq\nmruby bindings for https://github.com/zeromq/libzmq (v4)\n\nEverything libzmq offers is mapped 1:1 to the LibZMQ namespace, no beautification was done.\nHigh level ruby functions are inside the ZMQ Namespace, you can find most of it inside the mrblib folder, except some of the Msg and Socket classes functions which have to be done in c.\n\nInstallation\n============\n\nIf you dont have libzmq installed on a non Windows platform we will build it and statically link it into your mruby app.\nIf you have it installed you need to have pkg-config installed.\nThen add\n\n```ruby\nconf.gem mgem: 'mruby-zmq'\n```\nto your build_config.rb\n\nExamples\n========\n\nSockets\n-------\nClient to Server\n\n```ruby\nserver = ZMQ::Server.new(\"tcp://127.0.0.1:*\") # you can optionally add a boolean argument if it should connect instead of bind\nclient = ZMQ::Client.new(server.last_endpoint) # you can optionally add a boolean argument if it should bind instead of connect\n\nclient.send(\"hello\")\nmsg = server.recv\nputs msg['Peer-Address'] # This gets you the metadata of a message\nputs msg.to_str\nmsg2 = ZMQ::Msg.new(\"hello too\")\nmsg2.routing_id = msg.routing_id\nmsg2.send(server)\nputs client.recv.to_str\n```\n\nDealer to Router\n\n```ruby\nrouter = ZMQ::Router.new(\"tcp://127.0.0.1:*\")\ndealer = ZMQ::Dealer.new(router.last_endpoint)\n\ndealer.send(\"hello\")\nmsg = router.recv\nputs msg[1].to_str\nrouter.send([msg[0], \"hello too\"])\nputs dealer.recv.to_str\n```\n\nPub to Sub\n\n```ruby\npub = ZMQ::Pub.new(\"tcp://127.0.0.1:*\")\nsub = ZMQ::Sub.new(pub.last_endpoint, \"testme\")\n# you have to wait a short time here because of the slow joiner Problem\npub.send(\"testme hallo\")\nputs sub.recv.to_str\n```\n\nLogging\n=======\nYou can define a environment variable called ZMQ_LOGGER_ENDPOINT to create pub sockets which connect to that endpoint.\nThere is also a ZMQ_LOGGER_IDENT env var which adds a ident to each msg from ZMQ.logger\n\n```ruby\nZMQ.logger.info(\"hallo\")\n```\n\nLICENSE\n=======\nCopyright 2017,2021 Hendrik Beskow\n\n  This Source Code Form is subject to the terms of the Mozilla Public\n  License, v. 2.0. If a copy of the MPL was not distributed with this\n  project, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nContribution Policy\n===================\n\nmruby-zmq follows the C4 Process: https://rfc.zeromq.org/spec:42/C4\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Fmruby-zmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeromq%2Fmruby-zmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Fmruby-zmq/lists"}