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
From ver 2.1.0, `Task`is **retryable** for multiple times by using `try()` method ([Pull Request #9](https://github.com/ReactKit/SwiftTask/pull/9)).
112
-
For example, `task.try(n)` will retry at most `n-1` times if `task` keeps rejected, and `task.try(1)` is obviously same as `task` itself having no retries.
111
+
`Task`can retry for multiple times by using `retry()` method.
112
+
For example, `task.retry(n)` will retry at most `n` times (total tries = `n+1`) if `task` keeps rejected, and `task.retry(0)` is obviously same as `task` itself having no retries.
113
113
114
114
This feature is extremely useful for unstable tasks e.g. network connection.
115
115
By implementing *retryable* from `SwiftTask`'s side, similar code is no longer needed for `player` (inner logic) class.
116
116
117
117
```swift
118
-
task.try(3).progress { ... }.success { ...
118
+
task.retry(2).progress { ... }.success { ...
119
119
// this closure will be called even when task is rejected for 1st & 2nd try
0 commit comments