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

NIOTSELG: Provide EventLoopGroup.any() implementation #136

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

weissi
Copy link
Member

@weissi weissi commented Dec 3, 2021

See apple/swift-nio#2003 for details.

@weissi weissi requested a review from Lukasa December 3, 2021 15:34
@weissi weissi marked this pull request as draft December 3, 2021 15:35
@@ -187,21 +187,6 @@ class NIOTSListenerChannelTests: XCTestCase {
XCTAssertNoThrow(try channel.closeFuture.wait())
}

func testBindingChannelsOnShutdownEventLoopsFails() throws {
Copy link
Member Author

Choose a reason for hiding this comment

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

that wasn't actually a valid test. A shut down EL doesn't run anything...

@@ -647,21 +647,6 @@ class NIOTSConnectionChannelTests: XCTestCase {
XCTAssertNoThrow(try channel.close().wait())
}

func testConnectingChannelsOnShutdownEventLoopsFails() throws {
Copy link
Member Author

Choose a reason for hiding this comment

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

that wasn't actually a valid test. A shut down EL doesn't run anything...

@@ -21,7 +21,7 @@ let package = Package(
.library(name: "NIOTransportServices", targets: ["NIOTransportServices"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"),
.package(url: "https://github.com/apple/swift-nio.git", .branch("main")),
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be easiest to just immediately write this with a prediction of the version we need (it'll be the minor after the version we currently ship). The CI will fail, but that's fine, when it ships we should just be able to land this.

@@ -111,7 +128,18 @@ internal class NIOTSEventLoop: QoSEventLoop {

public func execute(qos: DispatchQoS, _ task: @escaping () -> Void) {
// Ideally we'd not accept new work while closed. Sadly, that's not possible with the current APIs for this.
self.taskQueue.async(qos: qos, execute: task)
let taskQueue = self.taskQueueLock.withLock {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we've got an on-event-loop fast-path, we should use it here.

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.

2 participants