0

I am somewhat confused in deepstream, is it possible to communicate to a client from my server? For example, is there any way to do something like this on a server? I am currently opening a client connection in browser that publishes to other clients. I would rather have the code below in my server.

var client = deepstream('localhost:6020').login()
var record = client.record.getRecord('new-record')

#Publish a message to all listeners of 'listen-channel' from my server?
record.set('listen-channel', 'message');

and then have clients listen:

record.subscribe('listen-channel', function(value) {
        console.log(value);
shell
  • 1,867
  • 4
  • 23
  • 39

1 Answers1

0

Sure, just run it from a node process. Deepstream "clients" can be backend and frontend processes alike, permissioning is used to distuinguish between who can do what.

enter image description here

wolframhempel
  • 1,094
  • 10
  • 12
  • Sorry for double post, but do you think one node process can handle all the requests coming from every client if the client pool gets large to very large? Thanks. – shell Nov 23 '16 at 17:03
  • Not really, but deepstream handles loadbalancing / distribution for you. - For RPCs multiple processes can register as providers and deepstream will route traffic between them. Individual providers can also deny a request, prompting deepstream to ask the next one - For records and events deepstream supports a feature called listening. Please find more about this here https://deepstream.io/tutorials/core/datasync-records/#listening – wolframhempel Nov 24 '16 at 10:35