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
I can see that a cipher stream calls 'end' asynchronously, i.e. at least in the next tick after cipher.end() is called.
I am not sure from the source though, if OpenSSL's EVP... methods are actually executed in the threadpool or in the main thread?
Does a createCipheriv() stream execute in the threadpool, or does it just execute in the main thread, while deferring the 'end' event with a nextTick()?
The text was updated successfully, but these errors were encountered:
Pretty much the only asynchronous (meaning executed in the thread pool) crypto API is crypto.randomBytes() (when a callback is passed), everything else is executed synchronously on the main thread currently.
In case anyone else is looking for async cipher, hash or hmac operations, I created a native module, crypto-async, to execute these in Node's threadpool without blocking the event loop. The latency is very close to Node's operations, but the throughput is much better because more CPU cores can be utilized. The module includes a latency and throughput comparison.
I can see that a cipher stream calls 'end' asynchronously, i.e. at least in the next tick after cipher.end() is called.
I am not sure from the source though, if OpenSSL's EVP... methods are actually executed in the threadpool or in the main thread?
Does a
createCipheriv()
stream execute in the threadpool, or does it just execute in the main thread, while deferring the 'end' event with anextTick()
?The text was updated successfully, but these errors were encountered: