---
title: "init(upstream:retries:)"
framework: combine
role: symbol
role_heading: Initializer
path: "combine/publishers/retry/init(upstream:retries:)"
---

# init(upstream:retries:)

Creates a publisher that attempts to recreate its subscription to a failed upstream publisher.

## Declaration

```swift
init(upstream: Upstream, retries: Int?)
```

## Parameters

- `upstream`: The publisher from which this publisher receives its elements.
- `retries`: The maximum number of retry attempts to perform. If nil, this publisher attempts to reconnect with the upstream publisher an unlimited number of times.
