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

better documentation for MultiThreadedEventLoopGroup #582

Merged
merged 2 commits into from
Aug 21, 2018

Conversation

weissi
Copy link
Member

@weissi weissi commented Aug 17, 2018

Motivation:

MultiThreadedEventLoopGroup's docs didn't make it clear that you leak
threads if not shut down.

Modifications:

Add clarification that you should shut down
MultiThreadedEventLoopGroups.

Result:

hopefully clearer documentation.

@weissi weissi requested a review from Lukasa August 17, 2018 10:41
/// - warning: Unit tests often spawn one `MultithreadedEventLoopGroup` per unit test to force isolation between the
/// tests. In those cases it's important to shut the `MultithreadedEventLoopGroup` down at the end of the
/// test. A good place to start a `MultithreadedEventLoopGroup` is the `setUp` method of your `XCTestCase`
/// subclass, a good place to shut it down is the `tearDown` method.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: a number of the references to the name of this class in this block have incorrect casing. The correct casing is MultiThreadedEventLoopGroup. Mind fixing those up?

@@ -920,7 +937,14 @@ final public class MultiThreadedEventLoopGroup: EventLoopGroup {
}
}

public func shutdownGracefully(queue: DispatchQueue, _ callback: @escaping (Error?) -> Void) {
/// Shut this `MultithreadedEventLoopGroup` down which causes the `EventLoop`s and their associated threads to be
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: you have the same casing problem here.

/// shut down and release their resources.
///
/// - parameters:
/// - queue: The `DispatchQueue` to run `handler` on when the shutdown operation finished.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: s/finished/completes/

///
/// - parameters:
/// - queue: The `DispatchQueue` to run `handler` on when the shutdown operation finished.
/// - handler: The handler which is called after the shutdown operation finished. The parameter will be `nil`
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: s/finished/completes/

Motivation:

MultiThreadedEventLoopGroup's docs didn't make it clear that you leak
threads if not shut down.

Modifications:

Add clarification that you should shut down
MultiThreadedEventLoopGroups.

Result:

hopefully clearer documentation.
@weissi weissi added the 🔨 semver/patch No public API change. label Aug 19, 2018
@weissi weissi added this to the 1.10.0 milestone Aug 19, 2018
@weissi
Copy link
Member Author

weissi commented Aug 21, 2018

@Lukasa mind having a quick look again?

@Lukasa Lukasa merged commit 7de224e into apple:master Aug 21, 2018
@weissi weissi deleted the jw-mtelg-docs branch August 21, 2018 10:56
@weissi weissi modified the milestones: 1.10.0, 1.9.3 Aug 28, 2018
weissi added a commit that referenced this pull request Aug 29, 2018
Motivation:

MultiThreadedEventLoopGroup's docs didn't make it clear that you leak
threads if not shut down.

Modifications:

Add clarification that you should shut down
MultiThreadedEventLoopGroups.

Result:

hopefully clearer documentation.
Motivation:

Explain here the context, and why you're making that change.
What is the problem you're trying to solve.

Modifications:

Describe the modifications you've done.

Result:

After your change, what will change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants