{"id":18275739,"url":"https://github.com/davideuler/zeromq-demo","last_synced_at":"2025-04-05T03:31:12.011Z","repository":{"id":138210918,"uuid":"21246655","full_name":"davideuler/zeromq-demo","owner":"davideuler","description":"python zeromq demo","archived":false,"fork":false,"pushed_at":"2014-06-28T06:15:39.000Z","size":140,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-20T21:38:20.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davideuler.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-26T16:05:51.000Z","updated_at":"2019-05-07T16:12:05.000Z","dependencies_parsed_at":"2023-03-12T15:00:15.006Z","dependency_job_id":null,"html_url":"https://github.com/davideuler/zeromq-demo","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/davideuler%2Fzeromq-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davideuler%2Fzeromq-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davideuler%2Fzeromq-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davideuler%2Fzeromq-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davideuler","download_url":"https://codeload.github.com/davideuler/zeromq-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284911,"owners_count":20913691,"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":[],"created_at":"2024-11-05T12:13:53.675Z","updated_at":"2025-04-05T03:31:06.978Z","avatar_url":"https://github.com/davideuler.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zeromq examples for python\n## single publisher demo\npub.py, sub.py : it shows how to subscribe messages from a zmq socket server 两个文件结合使用\n\nno-bubfer.py: a demo for sub and pub. 一个文件中，同时有sub和pub\n\n## one single file xpub, xsub demo\nx-pub.py: it shows how to use xsub \u0026 xpub in a single file  一个文件，完整的xpub,xsub示例\n\n## multiple publisher/subscriber demo\nan example for multi process, multi publisher, multi subscriber, 多个进程，多个publisher, 多个subscriber的例子\n\n\tx-pub-monitor.py\n\tx-pub-client.py\n\tx-pub-client-new.py\n\n\t\n\nFirstly, you start the x-pub-monitor.py,\n\nthen you can start x-pub-client.py, and x-pub-client2.py, and you will see that the two process will subscribed the same messages.\n\nFor easier comparison, I suggest to view the message recieving process in two vertical panel in tmux (http://tmux.sourceforge.net/):\n\nIn tmux, press Ctrl+B,% to split the screen vertically. Then Ctrl+B+Left, Ctrl+B+Right to swith the two panel.\n\nYou can start x-pub-client.py in the left panel of tmux, and x-pub-client-2.py in the right panel.\n## push/pull demo\npush.py\npull.py\n\n\nclient和server是对等的，就是说可以在push侧bind，也可以在client侧bind，服务器端bind,客户端connect。\n对于push/pull pattern，bind的socket会阻塞，直到客户端ready。\n\nTCP使用示例:\n对于TCP协议, server的一侧，服务器名要用星号*:\npython push.py \"tcp://localhost:3100”\npython pull.py \"tcp://*:3100\"\n\nIPC使用示例:\n\npython push.py \"ipc://name1:5678\"\npython pull.py \"ipc://name1:5678\"  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavideuler%2Fzeromq-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavideuler%2Fzeromq-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavideuler%2Fzeromq-demo/lists"}