Instance Method

retry(_:)

Attempts to recreate a failed subscription with the upstream publisher using a specified number of attempts to establish the connection.

Declaration

func retry(_ retries: Int) -> Publishers.Retry<Publishers.TryLastWhere<Upstream>>

Parameters

retries

The number of times to attempt to recreate the subscription.

Return Value

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

Discussion

After exceeding the specified number of retries, the publisher passes the failure to the downstream receiver.