Simplify receive implementation for transports (#78)
This commit is contained in:
parent
046fa3ee96
commit
29aa74d137
1 changed files with 7 additions and 32 deletions
|
|
@ -148,14 +148,7 @@ public actor HTTPClientTransport: Actor, Transport {
|
|||
|
||||
/// Receives data in an async sequence
|
||||
public func receive() -> AsyncThrowingStream<Data, Swift.Error> {
|
||||
return AsyncThrowingStream { continuation in
|
||||
Task {
|
||||
for try await message in messageStream {
|
||||
continuation.yield(message)
|
||||
}
|
||||
continuation.finish()
|
||||
}
|
||||
}
|
||||
return messageStream
|
||||
}
|
||||
|
||||
// MARK: - SSE
|
||||
|
|
|
|||
Loading…
Reference in a new issue