Delays delivery of all output to the downstream receiver by a specified amount of time on a particular scheduler.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Combine
Declaration
func delay<S>(for interval: S.SchedulerTimeType.Stride, tolerance: S.SchedulerTimeType.Stride? = nil, scheduler: S, options: S.SchedulerOptions? = nil) -> Publishers.Delay<Just<Output>, S> where S : Scheduler
Parameters
interval
The amount of time to delay.
tolerance
The allowed tolerance in firing delayed events.
scheduler
The scheduler to deliver the delayed events.
options
Options relevant to the scheduler’s behavior.
Return Value
A publisher that delays delivery of elements and completion to the downstream receiver.
Discussion
The delay affects the delivery of elements and completion, but not of the original subscription.