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.Output<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.