Skip to content
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
14 changes: 0 additions & 14 deletions Sources/GraphQLTransportWS/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,6 @@ public actor Client<InitPayload: Equatable & Codable> {
}
}

/// Listen and react to the provided async sequence of server messages. This function will block until the stream is completed.
/// - Parameter incoming: The server message sequence that the client should react to.
@available(*, deprecated, message: "Use `Data` sequence instead.")
public func listen<A: AsyncSequence & Sendable>(to incoming: A) async throws
where A.Element == String {
for try await stringMessage in incoming {
guard let message = stringMessage.data(using: .utf8) else {
try await self.error(.invalidEncoding())
return
}
try await respond(to: message)
}
}

private func respond(to message: Data) async throws {
let response: Response
do {
Expand Down
15 changes: 0 additions & 15 deletions Sources/GraphQLTransportWS/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,6 @@ where
}
}

/// Listen and react to the provided async sequence of client messages. This function will block until the stream is completed.
/// - Parameter incoming: The client message sequence that the server should react to.
@available(*, deprecated, message: "Use `Data` sequence instead.")
public func listen<A: AsyncSequence & Sendable>(to incoming: A) async throws
where A.Element == String {
for try await stringMessage in incoming {
guard let message = stringMessage.data(using: .utf8) else {
try await error(.invalidEncoding())
return
}

try await respond(to: message)
}
}

private func respond(to message: Data) async throws {
let request: Request
do {
Expand Down
Loading