# How discourse stays online (Message Bus, Faye, Long Polling)

**URL:** https://meta.discourse.org/t/how-discourse-stays-online-message-bus-faye-long-polling/3238
**Category:** Development
**Created:** [2013 年 2 月 16 日午後 8:20 UTC](https://meta.discourse.org/t/how-discourse-stays-online-message-bus-faye-long-polling/3238 "2013-02-16T20:20:50Z")
**Posts on this page:** 1
**Showing post:** 9

<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: [2013 年 2 月 17 日午前 7:18 UTC](https://meta.discourse.org/t/how-discourse-stays-online-message-bus-faye-long-polling/3238/9 "2013-02-17T07:18:54Z")

</div>

When you publish a message you specify who is allowed to see it:

```ruby
# only user id 100 will get secret santa
MessageBus.publish('/secret', 'santa', user_ids: [100])

```

The middleware will not distribute messages to users who are not allowed to see them

---

_[View the full topic](https://meta.discourse.org/t/how-discourse-stays-online-message-bus-faye-long-polling/3238)._
