Generic Enumeration


A strategy for handling exhaustion of a buffer’s capacity.


enum BufferingStrategy<Failure> where Failure : Error


Buffering Strategies

case dropNewest

When full, discard the newly-received element without buffering it.

case dropOldest

When full, remove the least recently-received element from the buffer.

case customError(() -> Failure)

When full, execute the closure to provide a custom error.

See Also

Buffering Elements

struct Publishers.Buffer

A publisher that buffers elements from an upstream publisher.

enum Publishers.PrefetchStrategy

A strategy for filling a buffer.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software