From @wyattsuen on Thu Aug 23 2018 14:52:59 GMT+0000 (UTC)
I have a service to accept data from remote servers, and need to broadcast the data to my other services. These other services(I use tornado) need to show these data on websocket connections. I think event driven program is suitable. But how can I use the @event_handler outside nameko but in tornado?
The document give the example, but I have no way to send the ‘payload’ to my tornado websocket server.
classs ServiceB: name='service_b' tornado_service=?? how can I inject the tornado websocket callback? @event_handler('service_a', 'event_type') def handle_event(self, payload): print('service b received:', payload) tornado_service.callback(payload)?? but tornado server can't embed in nameko server.
Are there any graceful way for nameko to open a standalone event handler in flask or tornado?
Copied from original issue: https://github.com/nameko/nameko/issues/570