Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: core async #478

Merged
merged 4 commits into from
Nov 19, 2019
Merged

refactor: core async #478

merged 4 commits into from
Nov 19, 2019

Conversation

jacobheun
Copy link
Contributor

This cleans up a few things in the main libp2p file for async.

  • Removed the state machine as we really don't need it
  • Removed promisify usage
  • Ping is currently disabled, that will be refactored in a followup PR
  • Autodial is now working with the async code
  • hangUp now correctly interacts with the registrar to close connections
    • hangUp now only accepts a PeerId to simplify the api
  • Fixed an issue with TransportManager for dial only nodes

@jacobheun jacobheun marked this pull request as ready for review November 19, 2019 23:06
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.

Looks good, just found some really minor things

src/index.js Outdated Show resolved Hide resolved
test/peer-discovery/index.spec.js Outdated Show resolved Hide resolved
test/peer-discovery/index.spec.js Outdated Show resolved Hide resolved
Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
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.

🚢

@jacobheun jacobheun merged commit 17946fb into refactor/async-await Nov 19, 2019
@jacobheun jacobheun deleted the refactor/core branch November 19, 2019 23:44
vasco-santos added a commit that referenced this pull request Nov 21, 2019
* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
vasco-santos added a commit that referenced this pull request Nov 21, 2019
* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
vasco-santos added a commit that referenced this pull request Nov 21, 2019
* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
dirkmc pushed a commit that referenced this pull request Nov 26, 2019
* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
dirkmc pushed a commit that referenced this pull request Nov 26, 2019
* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
jacobheun pushed a commit that referenced this pull request Nov 26, 2019
* refactor: core async (#478)

* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>

* fix: provide libp2p dialer to the dht

* chore: use dht release
jacobheun added a commit that referenced this pull request Dec 12, 2019
* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
jacobheun pushed a commit that referenced this pull request Dec 12, 2019
* refactor: core async (#478)

* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>

* fix: provide libp2p dialer to the dht

* chore: use dht release
jacobheun added a commit that referenced this pull request Jan 24, 2020
* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
jacobheun pushed a commit that referenced this pull request Jan 24, 2020
* refactor: core async (#478)

* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>

* fix: provide libp2p dialer to the dht

* chore: use dht release
maschad pushed a commit to maschad/js-libp2p that referenced this pull request Jun 21, 2023
Instead of debouncing and using timeouts to wait for DHT peers before
running the initial self-query, instead get the routing table to emit
events when peers are added or removed - if the table is empty when
we run the self-query, wait for the `peer:add` event before
continuing.

Improves startup time.

Adds tests for the query-self component.
maschad pushed a commit to maschad/js-libp2p that referenced this pull request Jun 21, 2023
## [9.3.5](libp2p/js-libp2p-kad-dht@v9.3.4...v9.3.5) (2023-05-26)

### Bug Fixes

* use events to delay before self-query ([libp2p#478](libp2p/js-libp2p-kad-dht#478)) ([46313a8](libp2p/js-libp2p-kad-dht@46313a8))

### Dependencies

* **dev:** bump delay from 5.0.0 to 6.0.0 ([libp2p#476](libp2p/js-libp2p-kad-dht#476)) ([50524f9](libp2p/js-libp2p-kad-dht@50524f9))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants