-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maybe an effecient way to broadcast message in the chat server application #16
Comments
Thank you very much for reading my book! Your remarks seems to be true. Actually the server code was based on the example in the Nim API docs, and the client was inspired by code of the book of Mr. Picheta that I read in late 2016 as pre-print. The async/await frame work has evolved since then. Actually I have never used the async/await pattern in my own code before, as I do no web stuff myself. That is the reason why this section came so late to the book, I generally prefer explaining things that I use a lot myself. But of course async/await is important for some people, and not all people may also have the book of Mr. Picheta, so I added the async/await section finally. |
thanks for the reply, i did not notice that. i looked it further, IMHO, the example in nim api doc is hard to understand, the lifetime of each task is not clear. |
I think we can let this issue open, I definitely will check your remarks. Note that there is also an alternative async implementation available from Status, called chronos, see https://github.com/status-im/nim-chronos |
i have heard about chronos some times and once again, finally i tried out it just now; it's amazing! all my doubts that occured during using std/asyncdispatch have been solved: cancellation, checkpoint/switch-task without fd required. |
first, i'd like to thank you for this awesome book, i have learnt a lot from it.
while reading the section about implementing a chat server application, i think
await asyncfutures.all clientSendFutures
will be more effecient than thefor ... await
.->
by using
asyncdispatch.all
, it turns linear sending to concurrentThe text was updated successfully, but these errors were encountered: