def add(self, item): try: task = HUEY.serialize_task(item.task) if task not in self.elements: self.elements.add(task) cache.set(self.task_group_id, self.elements) return task except PickleError: raise except AttributeError: raise
def discard(self, item): try: task = HUEY.serialize_task(item) self.elements.remove(task) except ValueError: pass
def __contains__(self, value): try: return HUEY.serialize_task(value) in self.elements except HueyException: return False