def first(self, queue_name, project=None, sort=1): cursor = self._list(queue_name, project=project, include_claimed=True, sort=sort, limit=1) try: message = next(cursor) except StopIteration: raise errors.QueueIsEmpty(queue_name, project) now = timeutils.utcnow_ts() return _basic_message(message, now)
def first(self, queue_name, project=None, sort=1): cursor = self._list(queue_name, project=project, include_claimed=True, sort=sort, limit=1) try: message = next(cursor) except StopIteration: raise errors.QueueIsEmpty(queue_name, project) return message