Closed zhouer closed 6 years ago
Hi @bun919tw I fix the parentheses issue (and re-write the git history for some reasons), please review again, thanks!
Flask-SocketIO got much more attentions, adoptions, and well maintained. SocketIO uses WebSocket as "one of its persistent connection solutions", but not uses WebSocket exclusively. To me, WebSocket is a W3C standard, but SocketIO is not a standard, and I preferred standardized protocols better. However, I can always switch to SocketIO, what do you think.
TBH, I just prefer the code style of the lib more haha. I don't really mind what's beneath (as long as they are stable enough). But yeah, I don't think this should be blocker or what, it's more just a personal preference on the lib.
By the way, I think supporting flask run
is possible by just adding a wrapper.
Flask-SocketIO overwrites flask command flask run
https://github.com/miguelgrinberg/Flask-SocketIO/blob/master/setup.py#L27
https://dormousehole.readthedocs.io/en/latest/cli.html#id11
Hi @boolafish
flask run
is still not supportedI'm not sure what functions will be needed for implementing plasma-cash, functions currently supported are more like proof of concepts. I will leave the tests in the future PR.
When sending transactions, the receiver client needs readltime notifications because it needs to confirm that the history has been received. And due to the clients may not always have public ip availability, it's easier to set a persistent connection between the server and a client, and let the server push notifications to clients.
Now, the child_chain_client connects to the server in its constructor, and provides
emit
,on
event system for easier communications. Also, the client can register its identity, like address, after connecting to the server, and the server can identify each client to send or relay messages. For example:Alice:
Bob:
And due to a WebSocket framework was introduced on server side, the server startup command was changed to
the orignal
flask run
command will failed to start the WebSocket service.