We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ServerSentEventsDeserializationSequence
1 parent 7c4f26a commit 91c7815Copy full SHA for 91c7815
Sources/OpenAPIRuntime/EventStreams/ServerSentEventsDecoding.swift
@@ -63,6 +63,10 @@ extension ServerSentEventsDeserializationSequence: AsyncSequence {
63
/// - Returns: `true` if the byte chunk should be forwarded, `false` if this byte chunk is the terminating sequence.
64
let predicate: (ArraySlice<UInt8>) -> Bool
65
66
+ /// Creates a new sequence.
67
+ /// - Parameters:
68
+ /// - upstream: The upstream sequence of arbitrary byte chunks.
69
+ /// - while: A closure that determines whether the given byte chunk should be forwarded to the consumer.
70
init(upstream: UpstreamIterator, while predicate: @escaping ((ArraySlice<UInt8>) -> Bool)) {
71
self.upstream = upstream
72
self.stateMachine = .init(while: predicate)
0 commit comments