<!--
{
  "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/Publishers/Timeout/init(upstream:interval:scheduler:options:customError:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine10PublishersO7TimeoutV8upstream8interval9scheduler7options11customErrorAEy_xq_Gx_17SchedulerTimeType_6StrideQY_q_0J7OptionsQy_Sg7FailureQzycSgtcfc"
  },
  "title" : "init(upstream:interval:scheduler:options:customError:)"
}
-->

# init(upstream:interval:scheduler:options:customError:)

Creates a publisher that terminates publishing if the upstream publisher exceeds the specified time interval without producing an element.

```
init(upstream: Upstream, interval: Context.SchedulerTimeType.Stride, scheduler: Context, options: Context.SchedulerOptions?, customError: (() -> Publishers.Timeout<Upstream, Context>.Failure)?)
```

## Parameters

`upstream`

The publisher from which this publisher receives elements.

`interval`

The maximum time interval the publisher can go without emitting an element, expressed in the time system of the scheduler.

`scheduler`

The scheduler on which to deliver events.

`options`

Scheduler options that customize the delivery of elements.

`customError`

A closure that executes if the publisher times out. The publisher sends the failure returned by this closure to the subscriber as the reason for termination.

---

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)