{"action":"created","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-22T02:12:23Z","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"},"comment":{"url":"https://api.github.com/repos/SamSaffron/message_bus/issues/comments/375155662","html_url":"https://github.com/SamSaffron/message_bus/issues/159#issuecomment-375155662","issue_url":"https://api.github.com/repos/SamSaffron/message_bus/issues/159","id":375155662,"user":{"login":"SamSaffron","id":5213,"avatar_url":"https://avatars1.githubusercontent.com/u/5213?v=4","gravatar_id":"","url":"https://api.github.com/users/SamSaffron","html_url":"https://github.com/SamSaffron","followers_url":"https://api.github.com/users/SamSaffron/followers","following_url":"https://api.github.com/users/SamSaffron/following{/other_user}","gists_url":"https://api.github.com/users/SamSaffron/gists{/gist_id}","starred_url":"https://api.github.com/users/SamSaffron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamSaffron/subscriptions","organizations_url":"https://api.github.com/users/SamSaffron/orgs","repos_url":"https://api.github.com/users/SamSaffron/repos","events_url":"https://api.github.com/users/SamSaffron/events{/privacy}","received_events_url":"https://api.github.com/users/SamSaffron/received_events","type":"User","site_admin":false},"created_at":"2018-03-22T02:12:22Z","updated_at":"2018-03-22T02:12:22Z","author_association":"OWNER","body":"I improved the readme a bit to cover data retention and add last_id\ndocumentation, any extra improvements to the readme are totally welcome.\n\nRegarding number of channels, it really depends on your data retention\nconcerns. More channels you add more data you retain in redis. performance\nwise we poll on multiple channels in one call so there is no need cut down\non channel counts just to keep traffic down.\n\nRegarding payload size, its a balancing act, on one hand you don't want to\ntrigger a thundering herd all asking app for the same payload at once. On\nthe other hand you don't want to store giant blobs in redis, especially if\nyou are doing catch up and may get multiple giant payloads on the client\nside.\n\nThere is like a giant blog post in replying to all your concerns here :)\nsorry for being brief. Readme PRs are totally welcome.\n\nOn Sat, Mar 17, 2018 at 2:05 AM, flprben <notifications@github.com> wrote:\n\n> I know this is something the mantainer asks for help in the Readme, but\n> where can I learn more about this awesome gem for now?\n>\n> For example, looking around in the web I found this:\n>\n> # the last local id on the chuck channel\n> id = MessageBus.last_id('/chuck')\n>\n> Source: https://meta.discourse.org/t/how-discourse-stays-online-\n> message-bus-faye-long-polling/3238/7\n>\n> It appears it's not documented anywhere, and it was something I was\n> looking for to having for subscribing on the client side after the last_id\n> the server found when rendering the page to the frontend (so that if new\n> messages were posted during render, client would be up-to-date starting\n> from the last_id that the server found when rendering the view).\n>\n> But I still have a lot of questions on how to implement this in production\n> in an efficient way ...\n>\n>    - should I use one channel per user / model ?\n>    - What are the consequences of having unlimited channels, like one for\n>    each model uuid, or should I restrict my channels to just a few ?\n>    - Should I pass HTML/JSON as data to use it on the frontend for\n>    replacing the HTML view, or a best practice would be to just use the\n>    channel to notify the frontend of an update, and then the frontend fires a\n>    new request for getting the updated HTML via ajax for instance?\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/SamSaffron/message_bus/issues/159>, or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAAUXexMnixmLrjuKaq-KhOTEF-KW2Wfks5te9TNgaJpZM4St8TZ>\n> .\n>\n"}}
{"actor":{"display_login":"SamSaffron"}}