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

feat: async await #87

Merged
merged 1 commit into from
Jul 11, 2019
Merged

feat: async await #87

merged 1 commit into from
Jul 11, 2019

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Oct 30, 2018

More background about this effort: ipfs/js-ipfs#1670.

Despite some createX function not needing async, I added it to all of them to make them consistent. Otherwise we would have half returning a Promise and another half returning a PeerId

Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

I think its ok for the synchronous methods to be synchronous. Making them async will slow them down unnecessarily as it'll force the resolved value onto a future tick.

I understand the desire for them to all be consistent but a) right now they are not, b) it'll slow things down and c) it'll be an even bigger breaking change (and we've already got a LOT of work to do)

P.S. this is awesome - thank you ❤️

src/bin.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
@hacdias
Copy link
Member Author

hacdias commented Oct 30, 2018

@alanshaw just made the updates 😄 I'll also take a look at peer-info later today!

@hacdias
Copy link
Member Author

hacdias commented Oct 31, 2018

Done @alanshaw!

@hacdias
Copy link
Member Author

hacdias commented Feb 25, 2019

@alanshaw should we re-do this or close?

@achingbrain
Copy link
Member

Rebased & merge conflicts resolved. Just need a release of libp2p/js-libp2p-crypto with libp2p/js-libp2p-crypto#131 in it and this should be good to go.

@alanshaw alanshaw changed the title [WIP] feat: async await feat: async await Jul 11, 2019
@alanshaw
Copy link
Member

Ready to merge \o/

@alanshaw
Copy link
Member

Needs BREAKING CHANGE message in squash commit.

BREAKING CHANGE: API refactored to use async/await

fix: remove async from non-async methods
fix: lint errors, use Boolean instead of !!
feat: re-add some timeouts to the tests
chore: rebase branch
chore: update libp2p-crypto dep

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@achingbrain
Copy link
Member

Commit message updated to have BREAKING CHANGE warning.

Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

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

Changes look good

@jacobheun
Copy link
Contributor

@pgte @daviddias can we get a minor release of this? 🙏

Perhaps it makes sense for @vasco-santos or I to take over lead maintainer on this, peer-info and peer-book?

@daviddias
Copy link
Member

daviddias commented Jul 11, 2019

@jacobheun done :)

Perhaps it makes sense for @vasco-santos or I to take over lead maintainer on this, peer-info and peer-book?

It does! Thank you 👍🏽

@jacobheun jacobheun merged commit c3463c7 into master Jul 11, 2019
@jacobheun jacobheun deleted the feat/async-await branch July 11, 2019 17:09
@jacobheun
Copy link
Contributor

0.13.0 is out and awaits you 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants