-
Notifications
You must be signed in to change notification settings - Fork 654
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
Conversation
Sources/NIO/EventLoop.swift
Outdated
/// - 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. |
There was a problem hiding this comment.
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?
Sources/NIO/EventLoop.swift
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
Sources/NIO/EventLoop.swift
Outdated
/// shut down and release their resources. | ||
/// | ||
/// - parameters: | ||
/// - queue: The `DispatchQueue` to run `handler` on when the shutdown operation finished. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: s/finished/completes/
Sources/NIO/EventLoop.swift
Outdated
/// | ||
/// - 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` |
There was a problem hiding this comment.
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.
@Lukasa mind having a quick look again? |
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.
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.