<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine10PublishersO7TimeoutV"
  },
  "title" : "Publishers.Timeout"
}
-->

# Publishers.Timeout

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

```
struct Timeout<Upstream, Context> where Upstream : Publisher, Context : Scheduler
```

## Topics

### Creating a timeout publisher

[`init(upstream:interval:scheduler:options:customError:)`](/documentation/Combine/Publishers/Timeout/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.

### Declaring supporting types

[`Output`](/documentation/Combine/Publishers/Timeout/Output)

The kind of values published by this publisher.

[`Failure`](/documentation/Combine/Publishers/Timeout/Failure)

The kind of errors this publisher might publish.

### Inspecting publisher properties

[`upstream`](/documentation/Combine/Publishers/Timeout/upstream)

The publisher from which this publisher receives elements.

[`interval`](/documentation/Combine/Publishers/Timeout/interval)

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

[`scheduler`](/documentation/Combine/Publishers/Timeout/scheduler)

The scheduler on which to deliver events.

[`options`](/documentation/Combine/Publishers/Timeout/options)

Scheduler options that customize the delivery of elements.

[`customError`](/documentation/Combine/Publishers/Timeout/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.

## Relationships

### Conforms To

[`Publisher`](/documentation/Combine/Publisher)

---

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)