Giter VIP home page Giter VIP logo

Comments (4)

haolian9 avatar haolian9 commented on August 30, 2024 2

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.
it is unbelievable that a third-party module is more mature and good shaped than a std module.

from nimprogrammingbook.

StefanSalewski avatar StefanSalewski commented on August 30, 2024 1

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

from nimprogrammingbook.

StefanSalewski avatar StefanSalewski commented on August 30, 2024

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.

from nimprogrammingbook.

haolian9 avatar haolian9 commented on August 30, 2024

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.
so i spent some times to write up another impl which is based on my past expirements using python's trio.

from nimprogrammingbook.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.