code: def enqueue(self, function, name=None, attempts=1):
          
          self.total += 1
          task = Task(self.workqueue)
          job_id = self.workqueue.enqueue(function, name, attempts)
          if job_id is not None:
              task.add_job_id(job_id)
          self._dbg(2, 'Function enqueued.')
          return task
docs: Places the given function in the queue and calls it as soon
          as a thread is available. To pass additional arguments to the
          callback, use Python's functools.partial().
  
          :type  function: function
          :param function: The function to execute.
          :type  name: string
          :param name: A name for the task.
          :type  attempts: int
          :param attempts: The number of attempts on failure.
          :rtype:  object
          :return: An object representing the task.