File tree Expand file tree Collapse file tree
Sources/GraphQLTransportWS
Tests/GraphQLTransportWSTests/Utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import Foundation
44public protocol Messenger : Sendable {
55 /// Send a message through this messenger
66 /// - Parameter message: The message to send
7- func send< S : Sendable & Collection > ( _ message: S ) async throws where S . Element == Character
7+ func send( _ message: Data ) async throws
88
99 /// Close the messenger
1010 func close( ) async throws
@@ -15,15 +15,3 @@ public protocol Messenger: Sendable {
1515 /// - code: An error code
1616 func error( _ message: String , code: Int ) async throws
1717}
18-
19- extension Messenger {
20- /// Send a message through this messenger
21- /// - Parameter message: The message to send
22- func send( _ message: Data ) async throws {
23- // TODO: Ideally Data is our native interface, and String is the extension.
24- // Since that change is breaking, we will do it on the next major version.
25- if let string = String ( data: message, encoding: . utf8) {
26- try await send ( string)
27- }
28- }
29- }
Original file line number Diff line number Diff line change @@ -14,10 +14,8 @@ actor TestMessenger: Messenger {
1414 self . continuation = continuation
1515 }
1616
17- func send< S: Sendable & Collection > ( _ message: S ) async throws where S. Element == Character {
18- if let data = String ( message) . data ( using: . utf8) {
19- continuation. yield ( data)
20- }
17+ func send( _ message: Data ) async throws {
18+ continuation. yield ( message)
2119 }
2220
2321 func error( _ message: String , code: Int ) async throws {
You can’t perform that action at this time.
0 commit comments