Giter Club home page Giter Club logo

Comments (8)

mhdawson avatar mhdawson commented on June 12, 2024 1

@Globik you can create PR that adds the example to that repository.

from node-addon-examples.

Globik avatar Globik commented on June 12, 2024

There it is on nodejs repo test napi. But bug or not a bug. Process crashes when invoking the same async function twice and more times. Did you tried their sample on your comp?

from node-addon-examples.

Globik avatar Globik commented on June 12, 2024

By the way here is a simplified example of napi create async work:
https://github.com/Globik/libqrencode-js/blob/master/simple_test/test_async.c
In pure C.

from node-addon-examples.

Globik avatar Globik commented on June 12, 2024

Emit event from cpp is good, but how to the same with a pure c's node_api.h?

from node-addon-examples.

Globik avatar Globik commented on June 12, 2024

If you are wandering about how to emit an event from plain C to node.js:
https://github.com/Globik/kore-mediasoup/tree/master/addon/emitter

from node-addon-examples.

mhdawson avatar mhdawson commented on June 12, 2024

@Globik it would be great if you could create examples that could be added to: https://github.com/nodejs/abi-stable-node-addon-examples

from node-addon-examples.

Globik avatar Globik commented on June 12, 2024

@mhdawson how to do it? Do I need a pull request with examples?

from node-addon-examples.

Globik avatar Globik commented on June 12, 2024

@mhdawson and the sample like this will do? Glib loop in a dedicated thread within nodejs addon N-API:
https://github.com/Globik/kore-mediasoup/blob/master/addon/emitter5/uv_glib.c

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.