{"id":18789851,"url":"https://github.com/bpkg/umq","last_synced_at":"2025-04-13T14:06:34.431Z","repository":{"id":12680901,"uuid":"15352998","full_name":"bpkg/umq","owner":"bpkg","description":"tcp message pushing and receiving in bash","archived":false,"fork":false,"pushed_at":"2014-05-26T04:44:27.000Z","size":256,"stargazers_count":30,"open_issues_count":1,"forks_count":2,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-27T05:03:06.887Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/bpkg.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":"2013-12-21T03:03:01.000Z","updated_at":"2022-05-21T03:41:43.000Z","dependencies_parsed_at":"2022-09-23T08:42:33.355Z","dependency_job_id":null,"html_url":"https://github.com/bpkg/umq","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpkg%2Fumq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpkg%2Fumq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpkg%2Fumq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpkg%2Fumq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bpkg","download_url":"https://codeload.github.com/bpkg/umq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724639,"owners_count":21151561,"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-07T21:08:49.561Z","updated_at":"2025-04-13T14:06:34.402Z","avatar_url":"https://github.com/bpkg.png","language":"Shell","readme":"umq\n=====\n\ntcp message pushing and receiving in bash\n\n## install\n\n[bpkg](https://github.com/bpkg/bpkg)\n\n```sh\n$ bpkg install umq -g\n```\n\n```sh\n$ make\n$ make check\n$ make install\n```\n\n## usage\n\n**server**\n\nListening on localhost can be achieved by simple providing a port:\n\n```sh\n$ umq recv 3000 | { \\\n  while read -r line; do \\\n    echo \"got: '$line'\"; \\\n  done; \\\n}\n```\n\nThis will create a server and listen on localhost port `3000` for all incoming tcp messages.\n\n**connecting**\n\nYou can connect and read from the server by using `umq recv` with a host and port:\n\n```sh\n$ umq recv localhost 3000\n```\n\n**pushing**\n\nPushing data to a umq receiver can be performed via `umq push`:\n\n```sh\n$ echo \"ping\" | umq push localhost 3000\n```\n\nThis should yield the following response on the server:\n\n```\ngot: 'ping'\n```\n\n## api\n\n```sh\nusage: umq \u003ccommand\u003e [-hV]\n\nexamples:\n$ echo \"hello world\" | umq push localhost 3000\n$ umq recv localhost 3000 | while read line; do \\\n      echo \"msg: $line\"; done\n\ncommands:\n  push \u003chost\u003e \u003cport\u003e      push message to host with port\n  recv \u003chost\u003e \u003cport\u003e      receive message on host with port\n  help \u003ccommand\u003e          see more information on a command\n\noptions:\n  -h, --help              display this message\n  -V, --version           output version\n```\n\n## examples\n\n### cpu histogram\n\nUsing `umq` with [histo](https://github.com/visionmedia/histo) allows\nfor data to be streamed via tcp to a histo chart\n\nSee [cpu-stream](https://gist.github.com/jwerle/8076956) for a preview.\n\n### wall server\n\nStreaming messages to `wall`.\n\nSee [wall-server](https://github.com/jwerle/umq/blob/master/examples/wall-server.sh).\n\n## caveats\n\nWhen multiple peers are connected via `umq recv \u003chost\u003e \u003cport\u003e` to a single umq receiver, messages are emitted to\neach peer via the (RR) [Round-Robin](http://en.wikipedia.org/wiki/Round-robin_scheduling) technique. For example:\n\n**server**\n\n```sh\n$ umq recv 3000 | while read -r chunk; do echo \"chunk: $chunk\"; done\nchunk:\nchunk: 0\nchunk: 1\nchunk: 2\nchunk: 3\nchunk: 4\nchunk: 5\nchunk: 6\nchunk: 7\nchunk: 8\nchunk: 9\nchunk: 10\nchunk: 11\n```\n\n**pusher**\n\n```sh\n$ i=0 while true; do echo echo \"$i\"; ((++i)); sleep .5; done | umq push localhost 3000\n```\n\n**peer 1**\n\n```sh\n$ umq recv localhost 3000\n\n2\n3\n4\n5\n8\n9\n10\n11\n```\n\n**peer 2**\n\n```sh\n$ umq recv localhost 3000\n\n6\n7\n```\n\n\n## license\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpkg%2Fumq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbpkg%2Fumq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpkg%2Fumq/lists"}