How does server is supposed to send data ?
Hello,
Using code in #1 , I was able to send data to server, so far so good. But how does the server is supposed to send data to client ? I looked at the doc and examples but I don't understand how it is meant to be done.
Thx
Did you solve this problem?
Has anyone solved this issue?
It's been a while since I was using this, but I believe you can call self.push(data) or self.push_from_producer(producer) from inside one of the on_* methods in your records dispatcher. Those methods come from astm.asynclib.AsyncChat via astm.protocol.ASTMProtocol via astm.server.RequestHandler, which is called by astm.server.Server.handle_accept().
https://github.com/kxepal/python-astm/blob/606a77407e59c2f2dd12d65a7b2d2e3c141ad8d9/astm/asynclib.py#L858-L874
You could also probably call the underlying self.send(data) method available via astm.asynclib.Dispatcher, but that's lower-level and you'll lose some of the protocol handling that's otherwise done for you.