Hi,
I'm writing a Nameko gateway service that acts as a wrapper around a websocket connection - the service needs to be able to manipulate the websocket connection in RPC methods (e.g. to update channel subscriptions), as well as having methods triggered in response to websocket messages (in order to broadcast events across the rest of the system). While writing either an Entrypoint (to trigger service methods) or Dependency Provider (to enable interaction within service methods) is straightforward, I'm not sure of the best way forward to implement both on the same underlying connection.
Is there an established pattern for this sort of interaction? Is the best pattern perhaps to implement the websocket connection itself as a Extension, and then somehow use it as a sub-extension singleton in separate Entrypoint & Dependency Provider implementations?
Thanks in advance,
Jonathan