File tree Expand file tree Collapse file tree 5 files changed +8
-7
lines changed
Tests/GraphQLWSTests/Utils Expand file tree Collapse file tree 5 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -27,5 +27,6 @@ let package = Package(
2727 name: " GraphQLWSTests " ,
2828 dependencies: [ " GraphQLWS " ]
2929 ) ,
30- ]
30+ ] ,
31+ swiftLanguageVersions: [ . v5, . version( " 6 " ) ]
3132)
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ struct GraphQLWSError: Error {
8888}
8989
9090/// Error codes for miscellaneous issues
91- public enum ErrorCode : Int , CustomStringConvertible {
91+ public enum ErrorCode : Int , CustomStringConvertible , Sendable {
9292 // Miscellaneous
9393 case miscellaneous = 4400
9494
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import GraphQL
44/// Server implements the server-side portion of the protocol, allowing a few callbacks for customization.
55///
66/// By default, there are no authorization checks
7- public class Server < InitPayload: Equatable & Codable > {
7+ public class Server < InitPayload: Equatable & Codable > : @ unchecked Sendable {
88 // We keep this weak because we strongly inject this object into the messenger callback
99 weak var messenger : Messenger ?
1010
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ struct TestAPI: API {
1616 }
1717}
1818
19- final class TestContext {
19+ final class TestContext : Sendable {
2020 let publisher = SimplePubSub < String > ( )
2121
2222 func hello( ) -> String {
@@ -35,7 +35,7 @@ struct TestResolver {
3535}
3636
3737/// A very simple publish/subscriber used for testing
38- class SimplePubSub < T> {
38+ class SimplePubSub < T: Sendable > : @ unchecked Sendable {
3939 private var subscribers : [ Subscriber < T > ]
4040
4141 init ( ) {
Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ import Foundation
77///
88/// Note that this only retains a weak reference to 'other', so the client should retain references
99/// or risk them being deinitialized early
10- class TestMessenger : Messenger {
10+ class TestMessenger : Messenger , @ unchecked Sendable {
1111 weak var other : TestMessenger ?
1212 var onReceive : ( String ) async throws -> Void = { _ in }
1313 let queue : DispatchQueue = . init( label: " Test messenger " )
1414
1515 init ( ) { }
1616
17- func send< S> ( _ message: S ) async throws where S: Collection , S. Element == Character {
17+ func send< S: Sendable > ( _ message: S ) async throws where S: Collection , S. Element == Character {
1818 guard let other = other else {
1919 return
2020 }
You can’t perform that action at this time.
0 commit comments