-
Notifications
You must be signed in to change notification settings - Fork 634
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
Adopt Sendable
for types in NIOHTTP1
#2213
Conversation
Sources/NIOHTTP1/HTTPTypes.swift
Outdated
@@ -36,7 +36,7 @@ internal enum KeepAliveState { | |||
|
|||
/// A representation of the request line and header fields of a HTTP request. | |||
public struct HTTPRequestHead: Equatable { | |||
private final class _Storage { | |||
fileprivate final class _Storage { |
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.
I change the access level from private
to fileprivate
to be able to mark _Storage
as non-sendable which is only possible in an extension. No strong optioned on that though, so happy to make it private
again.
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.
I think we don't need to mark internal types as non-sendable, so I'm happy for us to throw this away.
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.
private
again 9d78041
5c65c77
to
f18dae7
Compare
Sendable
in NIOHTTP1
Sendable
for types in NIOHTTP1
Sources/NIOHTTP1/HTTPTypes.swift
Outdated
@@ -36,7 +36,7 @@ internal enum KeepAliveState { | |||
|
|||
/// A representation of the request line and header fields of a HTTP request. | |||
public struct HTTPRequestHead: Equatable { | |||
private final class _Storage { | |||
fileprivate final class _Storage { |
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.
I think we don't need to mark internal types as non-sendable, so I'm happy for us to throw this away.
@@ -301,6 +301,10 @@ public final class NIOHTTPServerRequestAggregator: ChannelInboundHandler, Remova | |||
} | |||
} | |||
|
|||
#if swift(>=5.5) && canImport(_Concurrency) | |||
extension NIOHTTPServerRequestAggregator: @unchecked Sendable {} |
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.
There's no way this type is Sendable
.
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.
Ups 🫣... fixed in 9d78041
|
||
|
||
#if swift(>=5.5) && canImport(_Concurrency) | ||
extension NIOHTTPClientResponseAggregator: @unchecked Sendable {} |
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.
There's no way this type is Sendable
.
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.
Ups 🫣... fixed in 9d78041
…ggregator` non-Sendable
b9f1884
to
9d78041
Compare
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.
Nice work!
Incremental
Sendable
adoption