Giter Club home page Giter Club logo

Comments (10)

rvagg avatar rvagg commented on June 12, 2024

I totally agree and I've been thinking about this myself. Thanks for opening the issue!

from node-addon-examples.

nkzawa avatar nkzawa commented on June 12, 2024

+1

And thank you for awesome addon examples.

from node-addon-examples.

OrangeDog avatar OrangeDog commented on June 12, 2024

Found this.
http://nikhilm.github.io/uvbook/threads.html#libuv-work-queue

from node-addon-examples.

rvagg avatar rvagg commented on June 12, 2024

I used the example of calculating π by using a Monte Carlo estimation with a single worker vs multiple workers here: https://github.com/rvagg/node-worker-farm#example-1-estimating--using-child-workers

That might be an easy-to-understand example that could be adapted to demonstrate how async activity can work.

Although, ideally it might be good to come up with something that involves I/O since that ought to be the main use-case for async work in Node addons.

from node-addon-examples.

IngwiePhoenix avatar IngwiePhoenix commented on June 12, 2024

There is 9, which is async_work...so this should be it :)

from node-addon-examples.

vegetableman avatar vegetableman commented on June 12, 2024

+1

from node-addon-examples.

paulhauner avatar paulhauner commented on June 12, 2024

+1
I am trying to implement this at the moment and am struggling

from node-addon-examples.

paulhauner avatar paulhauner commented on June 12, 2024

I just created an example. It's lightweight and it works.

https://github.com/paulhauner/example-async-node-addon

from node-addon-examples.

NickNaso avatar NickNaso commented on June 12, 2024

Hi everyone, now there is an example about asynchronous operation here: https://github.com/nodejs/node-addon-examples/tree/master/async_pi_estimate

from node-addon-examples.

mhdawson avatar mhdawson commented on June 12, 2024

Since there is now an example, I'm going to close this, please let me know if that is not the right thing to do.

from node-addon-examples.

Related Issues (20)

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.