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: docs/Network.HTTP.Affjax.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,6 +144,14 @@ delete_ :: forall e. URL -> Affjax e Unit
144
144
145
145
Makes a `DELETE` request to the specified URL and ignores the response.
146
146
147
+
#### `retry`
148
+
149
+
```purescript
150
+
retry :: forall e a b. (Requestable a) => Maybe Int -> (AffjaxRequest a -> Affjax (avar :: AVAR | e) b) -> AffjaxRequest a -> Affjax (avar :: AVAR | e) b
151
+
```
152
+
153
+
Retry a request with exponential backoff, timing out optionally after a specified number of milliseconds. After the timeout, the last received response is returned; if it was not possible to communicate with the server due to an error, then this is bubbled up.
-- | The effect type for AJAX requests made with Affjax.
34
41
foreignimportdataAJAX :: !
@@ -117,6 +124,50 @@ delete u = affjax $ defaultRequest { method = DELETE, url = u }
117
124
delete_::foralle. URL->AffjaxeUnit
118
125
delete_ = delete
119
126
127
+
-- | Either we have a failure (which may be an exception or a failed response), or we have a successful response.
128
+
typeRetryStateea=Either (Eitherea) a
129
+
130
+
-- | Retry a request with exponential backoff, timing out optionally after a specified number of milliseconds. After the timeout, the last received response is returned; if it was not possible to communicate with the server due to an error, then this is bubbled up.
131
+
retry::foralleab. (Requestablea) =>MaybeInt-> (AffjaxRequesta->Affjax (avar::AVAR | e) b) -> (AffjaxRequesta->Affjax (avar::AVAR | e) b)
132
+
retry milliseconds run req = do
133
+
-- failureVar is either an exception or a failed request
0 commit comments