<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/Publisher/throttle(for:scheduler:latest:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine9PublisherPAAE8throttle3for9scheduler6latestAA10PublishersO8ThrottleVy_xqd__G17SchedulerTimeType_6StrideQYd___qd__SbtAA0I0Rd__lF"
  },
  "title" : "throttle(for:scheduler:latest:)"
}
-->

# throttle(for:scheduler:latest:)

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

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

## Parameters

`interval`

The interval at which to find and emit either the most recent or the first 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.

## Discussion

Use [`throttle(for:scheduler:latest:)`](/documentation/Combine/Publisher/throttle(for:scheduler:latest:)) to selectively republish elements from an upstream publisher during an interval you specify. Other elements received from the upstream in the throttling interval aren’t republished.

In the example below, a <doc://com.apple.documentation/documentation/Foundation/Timer/TimerPublisher> produces elements on one-second intervals; the [`throttle(for:scheduler:latest:)`](/documentation/Combine/Publisher/throttle(for:scheduler:latest:)) operator delivers the first event, then republishes only the latest event in the following ten second intervals:

```
cancellable = Timer.publish(every: 3.0, on: .main, in: .default)
    .autoconnect()
    .print("\(Date().description)")
    .throttle(for: 10.0, scheduler: RunLoop.main, latest: true)
    .sink(
        receiveCompletion: { print ("Completion: \($0).") },
        receiveValue: { print("Received Timestamp \($0).") }
     )

// Prints:
 //    Publish at: 2020-03-19 18:26:54 +0000: receive value: (2020-03-19 18:26:57 +0000)
 //    Received Timestamp 2020-03-19 18:26:57 +0000.
 //    Publish at: 2020-03-19 18:26:54 +0000: receive value: (2020-03-19 18:27:00 +0000)
 //    Publish at: 2020-03-19 18:26:54 +0000: receive value: (2020-03-19 18:27:03 +0000)
 //    Publish at: 2020-03-19 18:26:54 +0000: receive value: (2020-03-19 18:27:06 +0000)
 //    Publish at: 2020-03-19 18:26:54 +0000: receive value: (2020-03-19 18:27:09 +0000)
 //    Received Timestamp 2020-03-19 18:27:09 +0000.
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)