Skip to content

Commit

Permalink
Fix unused bufferingPolicy in StreamOf (#3668)
Browse files Browse the repository at this point in the history
### Goals ⚽
`StreamOf` has `bufferingPolicy` which is a private property but it's
not used inside the struct. This PR uses `bufferingPolicy` to create
`AsyncStream` in `makeAsyncIterator` so that the policy will be applied
while interacting `StreamOf`

Co-authored-by: ducnguyen <ducnguyen@axon.com>
  • Loading branch information
trungducc and ducnguyen committed Dec 11, 2022
1 parent d6f58ed commit ce7f662
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Concurrency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ public struct StreamOf<Element>: AsyncSequence {

public func makeAsyncIterator() -> Iterator {
var continuation: AsyncStream<Element>.Continuation?
let stream = AsyncStream<Element> { innerContinuation in
let stream = AsyncStream<Element>(bufferingPolicy: bufferingPolicy) { innerContinuation in
continuation = innerContinuation
builder(innerContinuation)
}
Expand Down

0 comments on commit ce7f662

Please sign in to comment.