Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.
/ abstract-leveldown Public archive

Fix and test asynchronicity of empty batch#337

Merged
vweevers merged 1 commit intomasterfrom
fix-empty-batch
Apr 26, 2019
Merged

Fix and test asynchronicity of empty batch#337
vweevers merged 1 commit intomasterfrom
fix-empty-batch

Conversation

@vweevers
Copy link
Copy Markdown
Member

@vweevers vweevers commented Apr 26, 2019

Closes #336.

  • db.batch([], callback) now calls callback asynchronously, bypassing _batch()
  • I considered doing the same for chained batch, by tracking if the batch has operations, but decided not to, so that implementations can choose to ignore certain operations. For example, batch.del(0) might be ignored and abstract-leveldown would wrongly think there's a queued operation.
  • Added abstract tests for asynchronicity of db.batch([]) (array-form) and db.batch() (chained-form)

@vweevers vweevers added bug Something isn't working semver-patch Bug fixes that are backward compatible labels Apr 26, 2019
@vweevers
Copy link
Copy Markdown
Member Author

Canary-tested against memdown and level-js as well, all good.

@vweevers vweevers merged commit 8b22c0d into master Apr 26, 2019
@vweevers vweevers deleted the fix-empty-batch branch April 26, 2019 14:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working semver-patch Bug fixes that are backward compatible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return early and call back asynchronously if batch is empty

2 participants