Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

feat: add streaming/cancellable API #39

Merged
merged 2 commits into from
May 7, 2020
Merged

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented May 7, 2020

Upgrades to the latest interface-datastore which includes streaming APIs and passing AbortControllers.

Uses the new Adapter class to implement these with minimal code changes.

  • Splits out open so it's not called from the constructor any more
  • Combines some of the private methods to make code flow simpler
  • Removes code duplicated by the interface adapter

Upgrades to the latest interface-datastore which includes streaming APIs and passing AbortControllers.

Uses the new Adapter class to implement these with minimal code changes.
@achingbrain achingbrain requested a review from hugomrdias May 7, 2020 16:01
Copy link
Member

@hugomrdias hugomrdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im confused but the removal of batch, query and close

@hugomrdias
Copy link
Member

everything comes from Adapter?

@achingbrain
Copy link
Member Author

That's right, everything's moved up into the adapter as there's quite a bit of duplication across the datastore implementations.

The adapter batch is a little slower because it does the puts, then the deletes, but the previous one in this repo did everything together in an unbounded Promise.all which could either swamp the process or leave the repo in an inconsistent state if you were puting and deleteing the same key.

@achingbrain achingbrain merged commit 5232c1c into master May 7, 2020
@achingbrain achingbrain deleted the feat/streaming-api branch May 7, 2020 16:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants