# Long message-bus HTTP requests? What are they for?

**URL:** <https://meta.discourse.org/t/long-message-bus-http-requests-what-are-they-for/62241>\
**Category:** Support\
**Created:** [5월 7, 2017, 6:02오전 UTC](https://meta.discourse.org/t/long-message-bus-http-requests-what-are-they-for/62241 "2017-05-07T06:02:57Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [5월 8, 2017, 2:20오후 UTC](https://meta.discourse.org/t/long-message-bus-http-requests-what-are-they-for/62241/14 "2017-05-08T14:20:44Z")

</div>

You can read about MessageBus here:

> [@How discourse stays online (Message Bus, Faye, Long Polling)](https://meta.discourse.org/t/how-discourse-stays-online-message-bus-faye-long-polling/3238/7):
>
> I wrote the message bus so I should answer this. However, before I answer anything let me explain the message bus. (in ruby code on the server) # publish the string norris to a channel called /chuck MessageBus.publish('/chuck', 'norris') # publish the string 'secret' to a channel called /check, but only to these particular user\_ids MessageBus.publish('/chuck', 'norris', user\_ids: [1,2,3]) # subscribe to the channel '/chuck' on the server MessageBus.subscribe('/chuck') do |msg| # yay, I …

[MessageBus](https://github.com/SamSaffron/message_bus) is responsible for pushing live notifications from the server to the clients.

So, for example, as soon as someone ❤'s this message I get a blue notification on the top right. Or if someone replies this page will refresh right away with the reply.

MessageBus using long polling with chunked encoding, what this means is that a single 30 second session can push multiple messages from the server to the client.

The 30 second requests here are not a performance concern, payloads are tiny and the server is designed to handle this traffic very easily. Since you are using H2 it does not even eat up a connection slot like it would in the old days of H1. Once browser moves to a background tab message bus is smart enough to slow down its polling.

---

_[View the full topic](https://meta.discourse.org/t/long-message-bus-http-requests-what-are-they-for/62241)._
