napi-rs/crates
Louis 5b5f616d81
fix(napi): no hard fail on ThreadsafeFunction::call_async (#1970)
For many reasons, in an app we can end up in a scenario where the thread / task that initially called the ThreadsafeFunction gets interrupted. This means that the receiver would get collected, should a ThreadsafeFunction be awaited on the said thread. This will create an error when the ThreadsafeFunction's callback will be called, and call a napi_fatal_error.

This change makes it so that if the send errors, this error is hidden and thus prevents any hard failure. If a ThreadsafeFunction is called in such a case, its output won't be used, but we'll still run all the logic to ensure it ran properly.

Fixes https://github.com/napi-rs/napi-rs/issues/1665 - cc @Brooooooklyn
2024-02-22 17:34:10 +08:00
..
backend Release independent packages 2024-02-17 22:58:31 +08:00
build Release independent packages 2024-02-19 19:10:16 +08:00
macro fix(napi-derive): napi-derive-backend version 2024-02-20 15:17:43 +08:00
napi fix(napi): no hard fail on ThreadsafeFunction::call_async (#1970) 2024-02-22 17:34:10 +08:00
sys Release independent packages 2023-11-07 14:18:36 +08:00