Open atitoff opened 3 months ago
how can I call "getJoke(self)" from another class instance? in your example they are not called anywhere...
client calls getJoke, server calls joke on the client, after the client returns the result, that result is a placed to the getJoke left on await.
The server cannot be the initiator of the message? Got it, I’ll write my own wrapper for the aiohttp websockets
You have any option for trigger event on the server side.
This library provides contract and implementation of the transport.
You may create a PubSub route
class Route(PrefixRoute):
SUBSCRIBERS = set()
def init(self):
self.SUBSCRIBERS.add(self.socket)
@classmethod
async def notify_all(cls, **kwargs):
await asyncio.gather(*[
sock.proxy.notify(**kwargs) for sock in cls.SUBSCRIBERS
])
Can I initiate a message from the server side? I didn't find it in the examples. Only if the request comes from the client side can I send a notification.