Skip to content

Commit 3cb5426

Browse files
committed
✨ Adds sample retry strategy that should cover most usecases.
1 parent d2ff8da commit 3cb5426

File tree

5 files changed

+679
-3
lines changed

5 files changed

+679
-3
lines changed

Sources/Extensions/Array.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ extension Array {
44
/// Splits the array into chunks of the specified size.
55
public func chunked(into size: Int) -> [[Element]] {
66
guard size > 0 else {
7-
assertionFailure("Size must not be zero.")
8-
return []
7+
preconditionFailure("Size must be greater than zero.")
98
}
109

1110
return stride(from: 0, to: count, by: size).map {

Sources/HTTPNetworking/Plugins/HTTPRequestRetrier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public protocol HTTPRequestRetrier {
2020

2121
/// A strategy that indicates to an ``HTTPRequest`` what approach should be taken when
2222
/// attempting to retry upon failure.
23-
public enum RetryDecision {
23+
public enum RetryDecision: Equatable {
2424
/// Indicates that a failing request should not be retried.
2525
case concede
2626
/// Indicates that a failing request should be reattempted.

0 commit comments

Comments
 (0)