You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-10
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Network layer for running requests like GET, POST, PUT, DELETE etc customizable
8
8
## Features
9
9
-[x] Multiplatform
10
10
-[x] Stand alone package without any dependencies using just Apple's facilities
11
-
-[x] Set up amount of attempts(retry) with **"Exponential backoff"** strategy if request fails. Exponential backoff is a strategy in which you increase the delays between retries.
11
+
-[x] Set up amount of attempts(retry) with **"Exponential backoff"**or **"Constant backoff"**strategy if request fails. Exponential backoff is a strategy in which you increase the delays between retries. Constant backoff is a strategy when delay between retries is a constant value
12
12
-[x] Customizable for different requests schemes from classic **CRUD Rest** to what suits to you
13
13
-[x] Customizable in term of URLSession
14
14
-[x] Customizable in terms of URLSessionTaskDelegate, URLSessionDelegate
@@ -62,19 +62,29 @@ Network layer for running requests like GET, POST, PUT, DELETE etc customizable
62
62
### Custom request
63
63
64
64
```swift
65
-
/// - Parameters:
66
-
/// - request: A URL load request that is independent of protocol or URL scheme
67
-
/// - retry: Amount of attempts Default value is 1
68
-
/// - taskDelegate: A protocol that defines methods that URL session instances call on their delegates to handle task-level events
69
-
funcsend(
70
-
withrequest : URLRequest,
71
-
retry : UInt=1,
72
-
_taskDelegate: ITaskDelegate?=nil
65
+
/// Send custom request based on the specific request instance
66
+
/// - Parameters:
67
+
/// - request: A URL load request that is independent of protocol or URL scheme
68
+
/// - retry: ``RetryService.Strategy`` strategy Default value .exponential with 5 retry and duration 2.0
69
+
/// - taskDelegate: A protocol that defines methods that URL session instances call on their delegates to handle task-level events
) asyncthrows-> Http.Response<T> where T :Decodable
73
75
```
74
76
77
+
## Retry strategy
78
+
79
+
| type | description |
80
+
| --- | --- |
81
+
| constant | The strategy implements constant backoff |
82
+
| exponential | The strategy implements exponential backoff |
83
+
84
+
75
85
# The concept
76
86
77
-
* Proxy is defining a communication layer and responsible for exchanging data with data source. There might be Http proxy, File proxy etc or some flavours REST proxy, LongFile proxy.
87
+
* Proxy is defining a communication layer and responsible for exchanging data with data source. There might be Http proxy, File proxy etc or some flavors REST proxy, LongFile proxy.
0 commit comments