{"action":"opened","issue":{"url":"https://api.github.com/repos/SamSaffron/message_bus/issues/159","repository_url":"https://api.github.com/repos/SamSaffron/message_bus","labels_url":"https://api.github.com/repos/SamSaffron/message_bus/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/SamSaffron/message_bus/issues/159/comments","events_url":"https://api.github.com/repos/SamSaffron/message_bus/issues/159/events","html_url":"https://github.com/SamSaffron/message_bus/issues/159","id":305963369,"number":159,"title":"Guides and examples","user":{"login":"feliperaul","id":743879,"avatar_url":"https://avatars3.githubusercontent.com/u/743879?v=4","gravatar_id":"","url":"https://api.github.com/users/feliperaul","html_url":"https://github.com/feliperaul","followers_url":"https://api.github.com/users/feliperaul/followers","following_url":"https://api.github.com/users/feliperaul/following{/other_user}","gists_url":"https://api.github.com/users/feliperaul/gists{/gist_id}","starred_url":"https://api.github.com/users/feliperaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feliperaul/subscriptions","organizations_url":"https://api.github.com/users/feliperaul/orgs","repos_url":"https://api.github.com/users/feliperaul/repos","events_url":"https://api.github.com/users/feliperaul/events{/privacy}","received_events_url":"https://api.github.com/users/feliperaul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-16T15:05:49Z","updated_at":"2018-03-16T15:05:49Z","closed_at":null,"author_association":"NONE","body":"I know this is something the mantainer asks for help in the Readme, but where can I learn more about this awesome gem for now?\r\n\r\nFor example, looking around in the web I found this:\r\n\r\n```\r\n# the last local id on the chuck channel\r\nid = MessageBus.last_id('/chuck')\r\n```\r\nSource: https://meta.discourse.org/t/how-discourse-stays-online-message-bus-faye-long-polling/3238/7\r\n\r\nIt appears it's not documented anywhere, and it was something I was looking for to having for subscribing on the client side after the last_id the server found when rendering the page to the frontend (so that if new messages were posted during render, client would be up-to-date starting from the last_id that the server found when rendering the view).\r\n\r\nBut I still have a lot of questions on how to implement this in production in an efficient way ... \r\n\r\n- should I use one channel per user / model ? \r\n- What are the consequences of having unlimited channels, like one for each model uuid, or should I restrict my channels to just a few ? \r\n- Should I pass HTML/JSON as data to use it on the frontend for replacing the HTML view, or a best practice would be to just use the channel to notify the frontend of an update, and then the frontend fires a new request for getting the updated HTML via ajax for instance?\r\n\r\n"}}
{"actor":{"display_login":"feliperaul"}}