Generic Instance Method

throttle(for:scheduler:latest:)

Publishes either the most-recent or first element published by the upstream publisher in the specified time interval.

Declaration

func throttle<S>(for interval: S.SchedulerTimeType.Stride, scheduler: S, latest: Bool) -> Publishers.Throttle<Publishers.Share<Upstream>, S> where S : Scheduler

Parameters

interval

The interval at which to find and emit the most recent element, expressed in the time system of the scheduler.

scheduler

The scheduler on which to publish elements.

latest

A Boolean value that indicates whether to publish the most recent element. If false, the publisher emits the first element received during the interval.

Return Value

A publisher that emits either the most-recent or first element received during the specified interval.

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