case dropped(Element)
The stream didn’t enqueue the element because the buffer was full.
case terminated
The stream didn’t enqueue the element because the stream was in a terminal state.
Availability
Technology
case enqueued(remaining: Int
)
This value represents the successful enqueueing of an element, whether the stream buffers the element or delivers it immediately to a pending call to next()
. The associated value remaining
is a hint that indicates the number of remaining slots in the buffer at the time of the yield
call.
Note 注意
From a thread safety perspective, remaining
is a lower bound on the number of remaining slots. This is because a subsequent call that uses the remaining
value could race on the consumption of values from the stream.
case dropped(Element)
case terminated