Closed bzroom closed 7 years ago
NChan.js is for subscribing only. To publish, you can POST to the pubsub (or publisher) location, or use the websocket in nchan.js directly (accessible at nchanSubscriberObject.transport.listener
).
It's probably a good idea to add publishing functionality in the future, but for the moment this is strictly a subscriber library.
Thank you for your response. In terms of abstracting the publishing, would we want to just register another callback for the transport for "onSend"? Each different transport would register this function. Websocket would call .send, but the others would wire up a POST.
I can see why it's a little weird. Because the decision to pub or sub actually happens in the server, often a publisher route is a different route all together. The client is not made aware of the capabilities (maybe it is, maybe it doesnt matter). Either way, i love this nginx module. I hope I can be a useful community member.
Closing this. I'll update it if I figure out how to add publishing into the mix.
Using this utility to subscribe to a pubsub route, how do we write a message to the publish end point?
Right now i'm trying to force it to use websockets and then i'm trying to get access to the websock so i can write a message but this seems like part of the nchan api that should be supported by the official client.