summaryrefslogtreecommitdiff
path: root/python/pgq/event.py
diff options
context:
space:
mode:
authorMarko Kreen2013-07-07 14:50:07 +0000
committerMarko Kreen2013-07-07 14:50:07 +0000
commit5ccf92bc8781da4ab57d34f0e13d88611c41db52 (patch)
tree044d3ed5da45cf11b07d89a029ea2c0b20fd203a /python/pgq/event.py
parent64f2e0b964fafff812b2e871d6c1d4ea079161d9 (diff)
pgq: move RetriableEvent to consumer.py
It's hard to get overview if the retry-related code is laying around in different places. As only Consumer class deals with retry, move all crap into same file.
Diffstat (limited to 'python/pgq/event.py')
-rw-r--r--python/pgq/event.py28
1 files changed, 1 insertions, 27 deletions
diff --git a/python/pgq/event.py b/python/pgq/event.py
index b083ba63..22e648a1 100644
--- a/python/pgq/event.py
+++ b/python/pgq/event.py
@@ -2,12 +2,7 @@
"""PgQ event container.
"""
-__all__ = ['EV_UNTAGGED', 'EV_RETRY', 'EV_DONE', 'Event', 'RetriableEvent']
-
-# Event status codes
-EV_UNTAGGED = -1
-EV_RETRY = 0
-EV_DONE = 1
+__all__ = ['Event']
_fldmap = {
'ev_id': 'ev_id',
@@ -67,24 +62,3 @@ class Event(object):
return "<id=%d type=%s data=%s e1=%s e2=%s e3=%s e4=%s>" % (
self.id, self.type, self.data, self.extra1, self.extra2, self.extra3, self.extra4)
-class RetriableEvent(Event):
- """Event which can be retryed
-
- Consumer is supposed to tag them after processing.
- """
-
- __slots__ = ('_status', )
-
- def __init__(self, queue_name, row):
- super(RetriableEvent, self).__init__(self, queue_name, row)
- self._status = EV_DONE
-
- def tag_done(self):
- self._status = EV_DONE
-
- def get_status(self):
- return self._status
-
- def tag_retry(self, retry_time = 60):
- self._status = EV_RETRY
- self.retry_time = retry_time