-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
The following is the setup and the issue I am running into:
- Singleton object contains a TaskQueue object.
- At some point, when deemed correct(attempt at unauthorized use), the TaskQueue object is cleared using remove all
- Afterwards, when trying to add tasks to TaskQueue object, tasks in the queue are not being run.
let queue = TaskQueue()
func init() {
downloadStuff()
}
func downloadStuff() {
queue.tasks += {[weak queue] result, next in
myTask(completion: { success in
if success {
next(nil)
}
else {
print("error out")
}
}
}
queue.run() {
print("completed")
}
}
func unauthorizedUse() {
queue.removeAll()
}
func authorizedUse() {
downloadStuff()
}
Metadata
Metadata
Assignees
Labels
No labels