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

std.net.curl: Move asynchronous stuff to lazily-instantiated namespace #6122

Merged
merged 1 commit into from Feb 4, 2018

Conversation

Projects
None yet
3 participants
@CyberShadow
Member

CyberShadow commented Feb 4, 2018

Allows avoiding importing std.concurrency unless asynchronous functionality actually needed.
Improves impact on import time by about 15%.

#5916 (comment)

@dlang-bot

This comment has been minimized.

Contributor

dlang-bot commented Feb 4, 2018

Thanks for your pull request, @CyberShadow!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach

Nice! Do you prefer the static: attribute label or the static attribute directly on the function?

@@ -1612,7 +1584,7 @@ private static struct AsyncLineInputRange(Char)
*
* If no data is available and the main thread accesses the range it will block
* until data becomes available. An exception to this is the $(D wait(Duration)) method on
* the $(LREF AsyncLineInputRange). This method will wait at maximum for the
* the $(LREF LineInputRange). This method will wait at maximum for the

This comment has been minimized.

@wilzbach
// @@@@BUG 15831@@@@
// this should be inside byLineAsync
// Range that reads one chunk at a time asynchronously.
private static struct ChunkInputRange

This comment has been minimized.

@wilzbach

wilzbach Feb 4, 2018

Member

static is redundant here.

This comment has been minimized.

@CyberShadow

CyberShadow Feb 4, 2018

Member

This one is safe to remove; not sure about the rest at a glance, since static can have additional effects on templates.

This comment has been minimized.

@CyberShadow

CyberShadow Feb 4, 2018

Member

Err actually there were two more non-templated functions.

std.net.curl: Move asynchronous stuff to lazily-instantiated namespace
Allows avoiding importing std.concurrency unless asynchronous
functionality actually needed. Improves impact on import time by about
15%.

@wilzbach wilzbach merged commit efe5e8f into dlang:master Feb 4, 2018

7 checks passed

CyberShadow/DAutoTest Documentation OK (7 additions, 7 deletions)
Details
auto-tester Pass: 10
Details
ci/circleci Your tests passed on CircleCI!
Details
codecov/changes No unexpected coverage changes found.
Details
codecov/patch 74.038% of diff hit (target 90.369%)
Details
codecov/project 90.369% remains the same compared to 3a9a8b8
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment