def __init__(self, function, queue="default", priority=False): self._function = function self._name = "{0}:{1}".format(function.__module__, function.__name__) self._queue = queue self._priority = priority self._jobs = self._thoonk.job(self._queue) _queues.setdefault(queue, {})[self._name] = self
def __init__(self, name, queue='default', priority=False, module=None): self._name = '{0}:{1}'.format(module, name) self._queue = queue self._priority = priority self._jobs = self._thoonk.job(self._queue) _queues.setdefault(queue, {})[self._name] = self