You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running an asynchronous FFI function (which is now possible, thank you!) that may be performing a long-running operation (in a separate thread), it is often valuable for the FFI function to be able to communicate back to the main JS thread during the course of its execution. Currently, the only communication back to the main thread is the completion of the FFI function, but being able to send multiple updates would be of significant value. This could potentially be done by being able to enqueue some type of "progress" or other notification events into the main JS event queue from the the FFI function that is executing.
Disclaimer: I'm not a Deno developer nor an expert in pretty much anything related.
I think the JS-native implementation of this would be an async iterator. However, that would require a very particular API for there to be any hope of Deno being able to offer an out-of-the-box solution. That, or there would need to be some sort of parametrization on the FFI calls.
It sort of seems to me like this would necessarily need to be user-land implemented.
When running an asynchronous FFI function (which is now possible, thank you!) that may be performing a long-running operation (in a separate thread), it is often valuable for the FFI function to be able to communicate back to the main JS thread during the course of its execution. Currently, the only communication back to the main thread is the completion of the FFI function, but being able to send multiple updates would be of significant value. This could potentially be done by being able to enqueue some type of "progress" or other notification events into the main JS event queue from the the FFI function that is executing.
Prior art from Node.js includes thread-safe functions and Nan::AsyncProgressWorker.
The text was updated successfully, but these errors were encountered: