4 ms·
What signatures are you referring to? They all take async callbacks.
by zbjornson 9y ago
What signatures are you referring to? They all take async callbacks.
- always_good 9y agoYes, and that's not an synchronous API. For example, https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback https://nodejs.org/api/crypto.html#crypto_crypto_randombytes... without the callback blocks. You said "Just because SQLite's API is synchronous does not mean that it must block the node process." I'm saying that's not true. A function might use threads behind the scenes, but if you're going to synchronously wait for it, you're blocking the event loop.
- zbjornson 9y agoThe OP and I are talking about the C API, not the node.js API, being sync.
- always_good 9y agoNo you weren't. Look at your first comment. You're literally relating sync in the C API with Node's API.
- zbjornson 9y agoMy first post was talking about the C API. A sync C API can be made into an async node.js API using the thread pool. That's what node does internally for DNS resolution, fs and other APIs.