Add a broadcast API. #231

Merged
merged 1 commit into from Mar 27, 2013

4 participants

@davidw

Alerts the web socket handler to the need to broadcast a message to some or all of the connected web sockets. It is up to the developer to keep track of the connected sockets.

See also: #193

@davidw davidw Add a broadcast API.
Alerts the web socket handler to the need to broadcast a message to
some or all of the connected web sockets.  It is up to the developer
to keep track of the connected sockets.
b0d0dc1
@davidw

The only thing I don't like about this approach is that for someone just getting started, figuring out all the web socket tracking code in their own handle_join / handle_close is going to be a pain.

@kotedo
@evanmiller

This patch feels like the right approach so I am merging it in. As Kai suggested I think the solution to the learning curve is to have some example code or a skeleton handler of some sort. I suppose in the future we could move to a higher level API with "groups" or something, but for now this seems good enough to me.

@evanmiller evanmiller merged commit d41471a into ChicagoBoss:master Mar 27, 2013
@rredpoppy

Hello, guys,

Examples for using this?

Edit: Issued a pull request with documentation for calling boss_service_worker:broadcast/2

@davidw

Sorry, I don't have any handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment