So I'm attempting to setup em-websocket (or potentially Goliath), so that users can come to a different route and thusly be subscribed to only that channel, so for example:
example.com/channel_1
Browsers open there will only receive messages published to channel_1
, actually to that point it doesn't have to be a route like this I'd settle for using params. So I'm using AMQP and it has the notion of a direct exchange, and routing keys. Is there something analogous to that with websockets?
I've got a Goliath server working but the issue is, that because it uses shared endpoints, I think that all the browsers open with a websocket connection are getting the same messages, here's what I'm doing:
channel.queue(params['channel'], :auto_delete => true).subscribe do |payload|
config['channel'].push(payload)
end
So this example uses AMQP, which I'd still like to use, but the issue I think lies in that each client is reinstantiating EM::Channel.new
, and then the messages are pushed to that channel, I just don't understand how I would have multiple clients subscribed to different channels.
Any help understanding this or guiding me to a more appropriate design pattern.