Skip to content

Conversation

@PierreMardon
Copy link
Contributor

Implements #27

  • upgrade SwiftLint plugin + non-exact version
  • Criterium => Criteria according to common usage
  • delete and remove need from RetryPolicy. retryDelay()
  • stateless nature was already taken into account in Swift 6 mode #26

@PierreMardon PierreMardon self-assigned this Jun 16, 2024
Comment on lines 15 to +19
func giveUpAfter(timeout: TimeInterval) -> RetryPolicy {
GiveUpOnPolicyWrapper(wrapped: self, giveUpCriterium: {
let nextAttemptStart = Date().addingTimeInterval(retryDelay(for: $0))
return nextAttemptStart >= $0.trialStart.addingTimeInterval(timeout)
})
GiveUpCriteriaPolicyWrapper(wrapped: self) { attempt, wrappedDelay in
let nextAttemptStart = Date().addingTimeInterval(wrappedDelay)
return nextAttemptStart >= attempt.trialStart.addingTimeInterval(timeout)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only reason retryDelay() was introduced.
As RetryPolicy is now considered stateless, there's no need to work around calling shouldRetry() in GiveUpCriteriaPolicyWrapper.

Base automatically changed from feature/25-swift6-mode to develop June 16, 2024 19:56
@PierreMardon PierreMardon force-pushed the feature/27-enhance-retry-policy-api branch from 0aff0d5 to 163bc9b Compare June 16, 2024 19:56
@PierreMardon PierreMardon force-pushed the feature/27-enhance-retry-policy-api branch from 163bc9b to a3c1e5c Compare June 16, 2024 19:58
@PierreMardon PierreMardon merged commit acf7e39 into develop Jun 16, 2024
@PierreMardon PierreMardon deleted the feature/27-enhance-retry-policy-api branch June 16, 2024 20:00
PierreMardon added a commit that referenced this pull request Jun 17, 2024
* Swift 6 mode (#26)

* Swift 6 mode, refs #25

* Update workflow

* Enhance RetryPolicy API, refs #27 (#28)

* Revert Swift 6 upgrade, activate concurrency checks, closes #31 (#32)

* Enhance README regarding stateless nature of retry policies, refs #33 (#34)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants