Skip to content

Queue not running  #19

Description

@sameerKLT

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()
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions