Skip to content

Commit 038a19b

Browse files
Merge pull request #11 from GraphQLSwift/chore/remove-deprecated-listen
Remove deprecated String listen
2 parents 4d90bf1 + 7c78f9c commit 038a19b

2 files changed

Lines changed: 1 addition & 30 deletions

File tree

Sources/GraphQLWS/Client.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,6 @@ public actor Client<InitPayload: Equatable & Codable> {
5757
}
5858
}
5959

60-
/// Listen and react to the provided async sequence of server messages. This function will block until the stream is completed.
61-
/// - Parameter incoming: The server message sequence that the client should react to.
62-
@available(*, deprecated, message: "Use `Data` sequence instead.")
63-
public func listen<A: AsyncSequence & Sendable>(to incoming: A) async throws
64-
where A.Element == String {
65-
for try await stringMessage in incoming {
66-
guard let message = stringMessage.data(using: .utf8) else {
67-
try await self.error(.invalidEncoding())
68-
return
69-
}
70-
try await respond(to: message)
71-
}
72-
}
73-
7460
private func respond(to message: Data) async throws {
7561
let response: Response
7662
do {

Sources/GraphQLWS/Server.swift

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ where
5252
self.onOperationComplete = onOperationComplete
5353
self.onOperationError = onOperationError
5454
}
55-
55+
5656
deinit {
5757
subscriptionTasks.values.forEach { $0.cancel() }
5858
}
@@ -66,21 +66,6 @@ where
6666
}
6767
}
6868

69-
/// Listen and react to the provided async sequence of client messages. This function will block until the stream is completed.
70-
/// - Parameter incoming: The client message sequence that the server should react to.
71-
@available(*, deprecated, message: "Use `Data` sequence instead.")
72-
public func listen<A: AsyncSequence & Sendable>(to incoming: A) async throws
73-
where A.Element == String {
74-
for try await stringMessage in incoming {
75-
guard let message = stringMessage.data(using: .utf8) else {
76-
try await error(.invalidEncoding())
77-
return
78-
}
79-
80-
try await respond(to: message)
81-
}
82-
}
83-
8469
private func respond(to message: Data) async throws {
8570
let request: Request
8671
do {

0 commit comments

Comments
 (0)