async-std
async-std copied to clipboard
Modernize a-chat
This has to be considered a draft.
The 2 major changes are:
- Move the client to use 2 concurrent tasks and selecting on them for any errors. The tasks are sufficiently diverse to merit 2 tasks.
- Move the 2 select statements to unified streams and having the broker and the client handle a set of "Events" themselves. This moves their logic down to a nice match.
The stream construction is still a bit ugly, though, especially in the client handling code of the server.