ryanb / private_pub

Handle pub/sub messaging through private channels in Rails using Faye.
MIT License
864 stars 228 forks source link

Exclude Clients #11

Open ryanb opened 13 years ago

ryanb commented 13 years ago

It would be nice if the publish_to method had an :exclude option where one could remove certain client ids from the message. A convenient :current option could be passed to automatically exclude the current sender of the request.

For example, let's say in the classic chat example we want the chatter's message to show up immediately and not wait for the faye callback. This means the faye message should only be sent to all other clients but not the current one because we handle that outside of this request. It could be done like this.

<% publish_to "/messages/new", :exclude => :current %>
  ...
<% end %>
elhu commented 12 years ago

I'm willing to look into that. Any pointers on where to start? I read the code quickly and I guess it's going to involve changing what private_pub sends to the Faye server, no?

ersatzryan commented 12 years ago

Where does this stand? Could you point me in the right direction to maybe adding this feature?