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

Async Refactor: query functions are now async functions #132

Merged
merged 4 commits into from
Jun 4, 2019

Conversation

kumavis
Copy link
Contributor

@kumavis kumavis commented Jun 3, 2019

This refactor changes the queryFns to be async. The makePath functions are still synchronous

const q = new Query(dht, peer.id.id, () => {
  // makePath: do once-per-path setup
  return async () => {
    // queryFn: do actual query
  }
})

No behavioral changes were intended, but some tests needed timeouts added to their query functions in order to resolve as expected

related #82

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @kumavis

It looks good and I only notice some minor details

src/index.js Outdated Show resolved Hide resolved
src/private.js Show resolved Hide resolved
src/utils.js Show resolved Hide resolved
test/kad-dht.spec.js Outdated Show resolved Hide resolved
test/query/index.spec.js Outdated Show resolved Hide resolved
test/query.spec.js Outdated Show resolved Hide resolved
test/query.spec.js Outdated Show resolved Hide resolved
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

LGTM!

src/private.js Show resolved Hide resolved
@vasco-santos vasco-santos merged commit 9e777e5 into master Jun 4, 2019
@vasco-santos vasco-santos deleted the feat/async-query-body branch June 4, 2019 14:33
@kumavis kumavis restored the feat/async-query-body branch June 9, 2019 15:29
@kumavis kumavis deleted the feat/async-query-body branch June 9, 2019 15:33
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.

3 participants