DripDrop needs a routing layer. Juggling addresses is way too much a PITA. Let's see if I can hack this out tonight...
Things it should do:
Allow ZMQ sockets to bind to multiple addresses
Auto-detect when a connection makes no sense (I.E. sending a ZMQ Pub message to a WebSocket)
Make delicious waffles.
It should look something like...
route :chat_ws, :websocket, 'ws://127.0.0.1:1234'
route :chat_in_zsub, :zmq_subscribe, :bind, 'tcp://127.0.0.1:12345'
So, it should pretty much just take a label, followed by the normal arguments used for constructing said socket. Then, it should magically make the socket. You'll be able to use the socket later by calling it by name.
So, given the routes above you could do:
chat_ws.on_recv {...}
Note, that including the abbreviated socket type in the route name is merely recommended, not required, but it's probably a good idea for sanity.
DripDrop needs a routing layer. Juggling addresses is way too much a PITA. Let's see if I can hack this out tonight...
Things it should do:
It should look something like... route :chat_ws, :websocket, 'ws://127.0.0.1:1234' route :chat_in_zsub, :zmq_subscribe, :bind, 'tcp://127.0.0.1:12345'
So, it should pretty much just take a label, followed by the normal arguments used for constructing said socket. Then, it should magically make the socket. You'll be able to use the socket later by calling it by name.
So, given the routes above you could do:
chat_ws.on_recv {...}
Note, that including the abbreviated socket type in the route name is merely recommended, not required, but it's probably a good idea for sanity.