Skip to content

Conversation

hardfist
Copy link

As the docs says, it seems napi_ref_threadsafe_function is not used to increase reference count, so the current deprecate notice seems misleading, also it seems tsfn clone can't replace the current refer semantic, so I'm not sure whether this api should be deprecated.

This API is used to indicate that the event loop running on the main thread should not exit until func has been destroyed. Similar to uv_ref it is also idempotent.
Neither does napi_unref_threadsafe_function mark the thread-safe functions as able to be destroyed nor does napi_ref_threadsafe_function prevent it from being destroyed. napi_acquire_threadsafe_function and napi_release_threadsafe_function are available for that purpose.

@hardfist hardfist changed the title fix: refer deprecated notice is misleading fix: refer deprecated notice is not accurate Feb 25, 2025
@Brooooooklyn Brooooooklyn force-pushed the main branch 3 times, most recently from de8b925 to 9896876 Compare August 7, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant