External Services Needing to communicate to client

Hi everyone, I’m new to Nakama. I’m trying to complete my architecture design and it looks like Streams will do it. I have the typical Client(s) interacting with the Nakama server, but then there are many other entity services running independently performing other tasks for the overall application. The communication cycle seems simple enough: I’m posting HTTP (JSON) requests from the client to the Entity services, each request comes with the Nakama UID (or any other identifying properties I’ll need)…This info goes off and does what it needs to do… but then getting the response back to the client (I don’t want to get into Websockets, using from Unity WebGL Apps) looks to be nice and simple: Connect to the Nakama server and send all the data back on the client stream through the Streams connection?

Thanks for any help!

I’m a little unclear what your problem is, so add more detail if I’m missing anything.

The Nakama Unity client supports the WebGL build target and will work fine with realtime socket connections.

You can have your external services make server-to-server requests to Nakama and in those RPC functions send messages over streams to any connected clients, assuming those clients have been placed on the correct streams already or you’re using one of the built-in mechanisms like in-app notifications.

Hi Zyro, thanks for responding. I’ve attached a quick work flow, picture should explain it better. Basically, aside from the Nakama handling of services, I also have Services outside of Nakama that will be processing work asked for by the Unity Client. I would like these Outside Services to communicate back to the Unity Client in an Async. manner through Nakama server. These Outside Services will know the Client ID and any other required Identifiers so the message can reach the particular client that had made the request. The last paragraph in your response seems to answer my question, that this is easily done.