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

Start removing allFutures #125

Merged
merged 10 commits into from
Apr 11, 2020
Merged

Start removing allFutures #125

merged 10 commits into from
Apr 11, 2020

Conversation

sinkingsugar
Copy link
Contributor

@sinkingsugar sinkingsugar commented Mar 29, 2020

Just by removing a few in lpchannel and use awaitne I finally realized how the program flow worked and specially each test termination... (check any CI to see yourself!)

@sinkingsugar
Copy link
Contributor Author

btw @cheatfate would be nice if we mark deprecate allFutures imho

@sinkingsugar
Copy link
Contributor Author

For now blocked by status-im/nim-chronos#87

libp2p/muxers/muxer.nim Outdated Show resolved Hide resolved
s.cleanUp()
)

for res in futs:
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems pretty repetitive, can we perhaps move this to a template, are they sufficiently similar to be able to generalize?

Copy link
Contributor

@dryajov dryajov left a comment

Choose a reason for hiding this comment

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

LGTM, but a few comments.

  • First, the error handling code is repetitive and can probably be generalized into a couple of templates, specially in LPChannel.
  • Second, all the error checking code does is fail/report the first exception. This seems like the most common pattern and an indication that this should be moved into allFinished or another allXXX primitive, that will simply do the same.

@sinkingsugar sinkingsugar merged commit 303ec29 into master Apr 11, 2020
@sinkingsugar sinkingsugar deleted the no-allfutures branch April 11, 2020 04:08
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.

4 participants