angular2-websocket icon indicating copy to clipboard operation
angular2-websocket copied to clipboard

subscribe to a topic

Open sysmat opened this issue 8 years ago • 1 comments
trafficstars

Is it possible after connection to subscribe to different topics, like Stomp client?

var webSocket = new $WebSocket("ws://127.0.0.1:8080/chat"); webSocket.getDataStream().subscribe("topic/bike", ...) webSocket.getDataStream().subscribe("topic/car", ...)

Regards, Tomaž

sysmat avatar Oct 11 '17 13:10 sysmat

It is not at the moment, using only the API exposed by angular2-websocket.

However, you could get this done by filtering or groupingBy getDataStream() response. See sugestions on both aproaches here:

https://stackoverflow.com/questions/28854688/split-rx-observable-into-multiple-streams-and-process-individually

mautematico avatar Oct 14 '17 18:10 mautematico