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

remove phantom publics from EventLoop and Heap #1298

Merged
merged 1 commit into from
Dec 11, 2019

Conversation

weissi
Copy link
Member

@weissi weissi commented Dec 9, 2019

Motivation:

In SelectableEventloop, Heap, PriorityQueue, etc there were quite a few
phantom publics left which cause issues with #1257 and are confusing.

Modifications:

  • remove the phantom publics
  • move SelectableEventLoop to its own file

Result:

  • clearer what's going on (public means public)

@weissi weissi requested a review from Lukasa December 9, 2019 19:01
/// The whole processing of I/O and tasks is done by a `NIOThread` that is tied to the `SelectableEventLoop`. This `NIOThread`
/// is guaranteed to never change!
@usableFromInline
internal final class SelectableEventLoop: EventLoop {
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 stuff is just moved apart from s/public/internal and fallout like @usableFromInline etc.

@weissi weissi added the 🔨 semver/patch No public API change. label Dec 9, 2019
@weissi weissi added this to the 2.12.0 milestone Dec 9, 2019
Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -633,7 +633,8 @@ enum NIORegistration: Registration {
}

/// Execute the given closure and ensure we release all auto pools if needed.
private func withAutoReleasePool<T>(_ execute: () throws -> T) rethrows -> T {
@inlinable
internal func withAutoReleasePool<T>(_ execute: () throws -> T) rethrows -> T {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than make this internal and @inlinable, is there any reason not simply to move it to the file with its new usage?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Lukasa I can revert it but I didn't see a reason not to make it available in tests etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Lukasa also it now needs to be usableFromInline/inlinable which requires internal, I'll move it to the SelectableEventLoop file though

Sources/NIO/EventLoop.swift Outdated Show resolved Hide resolved
Sources/NIO/EventLoop.swift Outdated Show resolved Hide resolved
Sources/NIO/PriorityQueue.swift Show resolved Hide resolved
@weissi weissi force-pushed the jw-rm-phantom-public branch from 2177013 to b573f7e Compare December 10, 2019 11:53
@weissi weissi requested a review from Lukasa December 10, 2019 11:55
Motivation:

In SelectableEventloop, Heap, PriorityQueue, etc there were quite a few
phantom publics left which cause issues with apple#1257 and are confusing.

Modifications:

- remove the phantom publics
- move SelectableEventLoop to its own file

Result:

- clearer what's going on (public means public)
@weissi weissi force-pushed the jw-rm-phantom-public branch from b573f7e to 2b80716 Compare December 11, 2019 18:04
@weissi weissi merged commit 5a56770 into apple:master Dec 11, 2019
@weissi weissi deleted the jw-rm-phantom-public branch December 11, 2019 18:41
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.

3 participants