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

Add more Sendable conformances to resolve warnings #309

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Foundation
@available(iOS 13, *)
final class ClientOnlyAsyncStream<
Input: ProtobufMessage, Output: ProtobufMessage
>: BidirectionalAsyncStream<Input, Output> {
>: BidirectionalAsyncStream<Input, Output>, @unchecked Sendable {
private let receivedResults = Locked([StreamResult<Output>]())

override func handleResultFromServer(_ result: StreamResult<Output>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import SwiftProtobuf

/// Represents a bidirectional stream that can be interacted with using async/await.
@available(iOS 13, *)
public protocol BidirectionalAsyncStreamInterface<Input, Output> {
public protocol BidirectionalAsyncStreamInterface<Input, Output>: Sendable {
/// The input (request) message type.
associatedtype Input: ProtobufMessage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SwiftProtobuf
/// Represents a client-only stream (a stream where the client streams data to the server and
/// eventually receives a response) that can be interacted with using async/await.
@available(iOS 13, *)
public protocol ClientOnlyAsyncStreamInterface<Input, Output> {
public protocol ClientOnlyAsyncStreamInterface<Input, Output>: Sendable {
/// The input (request) message type.
associatedtype Input: ProtobufMessage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SwiftProtobuf
/// Represents a server-only stream (a stream where the server streams data to the client after
/// receiving an initial request) that can be interacted with using async/await.
@available(iOS 13, *)
public protocol ServerOnlyAsyncStreamInterface<Input, Output> {
public protocol ServerOnlyAsyncStreamInterface<Input, Output>: Sendable {
/// The input (request) message type.
associatedtype Input: ProtobufMessage

Expand Down
2 changes: 1 addition & 1 deletion Libraries/ConnectNIO/Public/NIOHTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import Connect
import Foundation
import NIOConcurrencyHelpers
import NIOCore
@preconcurrency import NIOCore // TODO: Convert to normal import once `ChannelHandler` is `Sendable`
import NIOHTTP1
import NIOHTTP2
import NIOPosix
Expand Down
2 changes: 1 addition & 1 deletion Tests/ConformanceClient/Sources/ConformanceInvoker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SwiftProtobuf

/// Class responsible for running a specific conformance test case against a service.
@available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *)
final class ConformanceInvoker {
final class ConformanceInvoker: Sendable {
private let client: ConformanceClient
private let context: ConformanceRequest

Expand Down
Loading