{"id":22901772,"url":"https://github.com/mbuczko/syncshare","last_synced_at":"2025-08-12T05:30:54.131Z","repository":{"id":26174911,"uuid":"29620572","full_name":"mbuczko/syncshare","owner":"mbuczko","description":"rabbitmq based synchronization between browsers and backend workers","archived":true,"fork":false,"pushed_at":"2015-08-07T21:49:13.000Z","size":436,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T05:44:17.773Z","etag":null,"topics":["erlang","rabbitmq"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/mbuczko.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":"2015-01-21T22:07:08.000Z","updated_at":"2024-03-07T19:47:38.000Z","dependencies_parsed_at":"2022-07-22T18:47:20.126Z","dependency_job_id":null,"html_url":"https://github.com/mbuczko/syncshare","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mbuczko/syncshare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbuczko%2Fsyncshare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbuczko%2Fsyncshare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbuczko%2Fsyncshare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbuczko%2Fsyncshare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbuczko","download_url":"https://codeload.github.com/mbuczko/syncshare/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbuczko%2Fsyncshare/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270006451,"owners_count":24511153,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["erlang","rabbitmq"],"created_at":"2024-12-14T01:40:50.367Z","updated_at":"2025-08-12T05:30:53.701Z","avatar_url":"https://github.com/mbuczko.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Syncshare - RabbitMQ based instant notification system\n\nThis is a concept of bridge between http clients and the backend workers basing on pubsub (rabbitMQ in this case) and cowboy server holding all WebSocket- and Server Sent Events connections alive. Having connection established, the client side (browser) is able to send asynchronous RPC commands which will be processed by one of assigned worker processes. \n\nResponse may be sent back to origin or to all clients (browsers) connected to given service. You may imagine this kind of response as broadcast one.\n\nFollowing is a diagrams which explains connection between components:\n\n![connections](https://github.com/mbuczko/syncshare/blob/master/syncshare.png \"connections\")\n\n## Usage\n\nTo be able to use SyncShare on client side, a javascript client library should be added:\n\n    \u003cscript type=\"text/javascript\" src=\"js/client.js\"\u003e\u003c/script\u003e\n    \nNow it's time to define a SyncShare client and connect to the service:\n\n    new Syncshare.Client('http://my-synshare-service.com', {transport: 'websockets'}).connect(function(session) {\n        ...\n    });\n    \nWith no surprise, possible transports are: ```websockets``` and ```sse```.\n\nHaving connection established and session ready we may try to call some rpc functions:\n\n    session.rpc().comment({comment: 'lorem ipsum', userId: 123})\n\t\t  .then(\n\t\t\t\tfunction(success) {\n\t\t\t\t\tconsole.log('SUCCESS', success);\n\t\t\t\t},\n\t\t\t\tfunction(error) {\n\t\t\t\t\tconsole.log('ERROR', error);\n\t\t\t\t});\n\nOr we may listen to certain events coming from workers:\n\n    session.on('comment', function(data, isBroadcast) {\n\t\t\t\tconsole.log(data, 'BROADCAST', isBroadcast);\n\t\t\t})\n\t\t\t.on('upload', function(data, isBroadcast) {\n\t\t\t\tconsole.log(data, 'BROADCAST', isBroadcast);\n\t\t\t});\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbuczko%2Fsyncshare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbuczko%2Fsyncshare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbuczko%2Fsyncshare/lists"}