Level / abstract-level

Abstract class for a lexicographically sorted key-value database.
MIT License
123 stars 8 forks source link

Breaking: remove callbacks in favor of promises #50

Closed vweevers closed 1 year ago

vweevers commented 1 year ago

Applies to both the public and private API. If you were already using promises in the public API, nothing changed, except for subtle timing differences. In the private API, it means that function signatures like _get(key, options, callback) have changed to async _get(key, options).

In addition:

TODO:

vweevers commented 1 year ago

Ouch: I wondered why tests are passing in Node 12 (I didn't expect it to, for lack of AbortController). Turns out, they aren't passing, but the exit code is 0. Must be a bug in faucet which was recently updated.

vweevers commented 1 year ago

Now comes the fun part: using promises in the C++ of classic-level.

Edit: that's surprisingly easy (at least for basic methods like put()) and performance is roughly the same. No blockers :)