Skip to content

Improve AsyncWorker example handling Object/Buffer/Uint8Array as parameter #380

Description

@mahnunchik

Hello,

I've created issue in node-addon-api nodejs/node-addon-api#1453 but it may be related more to scope of this repository.

I couldn't find in the documentation and examples how to properly handle Object/Buffer/Uint8Array parameters in AsyncWorker?

nodejs/node-addon-api#1453

Activity

  1. legendecas commented on Mar 5, 2024

    @legendecas
    Member

    I believe https://github.com/nodejs/node-addon-examples/tree/main/src/4-references-and-handle-scope/function-reference-demo/node-addon-api can be a good example to prevent objects from being reclaimed by the garbage collector.

  2. mahnunchik commented on Mar 5, 2024

    @mahnunchik
    Author

    Yes it is good starting point, but working with AsyncWorker is a bit different because it was not clear to me where to wrap and where to release data. Now it is clear for me nodejs/node-addon-api#1453 (comment) but I think example can be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions