Skip to content

Commit

Permalink
EventStream: remove predicate property in `ServerSentEventsDeserial…
Browse files Browse the repository at this point in the history
…izationSequence` iterator
  • Loading branch information
paulhdk committed Oct 3, 2024
1 parent 97bda70 commit 0d4345e
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,13 @@ extension ServerSentEventsDeserializationSequence: AsyncSequence {
/// The state machine of the iterator.
var stateMachine: StateMachine

/// A closure that determines whether the given byte chunk should be forwarded to the consumer.
/// - Parameter: A byte chunk.
/// - Returns: `true` if the byte chunk should be forwarded, `false` if this byte chunk is the terminating sequence.
let predicate: (ArraySlice<UInt8>) -> Bool

/// Creates a new sequence.
/// - Parameters:
/// - upstream: The upstream sequence of arbitrary byte chunks.
/// - while: A closure that determines whether the given byte chunk should be forwarded to the consumer.
init(upstream: UpstreamIterator, while predicate: @escaping ((ArraySlice<UInt8>) -> Bool)) {
self.upstream = upstream
self.stateMachine = .init(while: predicate)
self.predicate = predicate
}

/// Asynchronously advances to the next element and returns it, or ends the
Expand Down

0 comments on commit 0d4345e

Please sign in to comment.