File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff line change 5252 self . onOperationComplete = onOperationComplete
5353 self . onOperationError = onOperationError
5454 }
55-
55+
5656 deinit {
5757 subscriptionTasks. values. forEach { $0. cancel ( ) }
5858 }
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 {
You can’t perform that action at this time.
0 commit comments