Instance Method

buffer(size:prefetch:whenFull:)

Buffers elements received from an upstream publisher.

Declaration

func buffer(size: Int, prefetch: Publishers.PrefetchStrategy, whenFull: Publishers.BufferingStrategy<Error>) -> Publishers.Buffer<Publishers.TryLastWhere<Upstream>>

Parameters

size

The maximum number of elements to store.

prefetch

The strategy for initially populating the buffer.

whenFull

The action to take when the buffer becomes full.

Return Value

A publisher that buffers elements received from an upstream publisher.