Skip to content

Commit 374ae1a

Browse files
committed
Add more task names.
1 parent de5c6f1 commit 374ae1a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SwiftTask/SwiftTask.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ public class Task<Progress, Value, Error>: Printable
191191
self.init(initClosure: { progress, fulfill, reject, configure in
192192
fulfill(value)
193193
})
194+
self.name = "FulfilledTask"
194195
}
195196

196197
///
@@ -203,6 +204,7 @@ public class Task<Progress, Value, Error>: Printable
203204
self.init(initClosure: { progress, fulfill, reject, configure in
204205
reject(error)
205206
})
207+
self.name = "RejectedTask"
206208
}
207209

208210
///
@@ -373,7 +375,9 @@ public class Task<Progress, Value, Error>: Printable
373375
/// Creates cloned task.
374376
public func clone() -> Task
375377
{
376-
return Task(weakified: self._weakified, paused: self._paused, _initClosure: self._initClosure)
378+
let clonedTask = Task(weakified: self._weakified, paused: self._paused, _initClosure: self._initClosure)
379+
clonedTask.name = "\(self.name)-clone"
380+
return clonedTask
377381
}
378382

379383
/// Returns new task that is retryable for `maxTryCount-1` times.

0 commit comments

Comments
 (0)