-
Notifications
You must be signed in to change notification settings - Fork 176
Closed
Description
Is it possible to retain task while it is executed in one scope? I have found that tasks deinit after creating )) even they are returned from success block of other task. Probably we need something that will retain task while it is executing like in next example:
public class Task<Progress, Value, Error> {
//...
class func createTask<Progress, Value, Error>(initClosure: InitClosure) -> Task<Progesss, Value, Error> {
// Paused
let task = Task<Progesss, Value, Error>(paused: true, initClosure: initClosure)
task.onFinish = {
TasksRegistry.unregister(task) // Release
}
TasksRegistry.register(task) // Retain
return task
}
//...
}
Or is there any other ways to do so?
Metadata
Metadata
Assignees
Labels
No labels