Skip to content

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

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

Merged
merged 1 commit into from
Feb 4, 2018

Conversation

CyberShadow
Copy link
Member

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

#5916 (comment)

@dlang-bot
Copy link
Contributor

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.

Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

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

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
Copy link
Member

Choose a reason for hiding this comment

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

👍

std/net/curl.d Outdated
// @@@@BUG 15831@@@@
// this should be inside byLineAsync
// Range that reads one chunk at a time asynchronously.
private static struct ChunkInputRange
Copy link
Member

Choose a reason for hiding this comment

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

static is redundant here.

Copy link
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Err actually there were two more non-templated functions.

Allows avoiding importing std.concurrency unless asynchronous
functionality actually needed. Improves impact on import time by about
15%.
@CyberShadow CyberShadow force-pushed the std-net-curl-async-ns branch from 89bf93d to d60fcf6 Compare February 4, 2018 11:48
@wilzbach wilzbach merged commit efe5e8f into dlang:master Feb 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants