|
@@ -70,6 +70,7 @@ class queue(object):
|
70
|
70
|
"""
|
71
|
71
|
class job(object):
|
72
|
72
|
def __init__(self, priority, callback, *args, **kwargs):
|
|
73
|
+ self.time = time.time()
|
73
|
74
|
self.priority = priority
|
74
|
75
|
self.callback = callback
|
75
|
76
|
self.args = args
|
|
@@ -79,7 +80,10 @@ class queue(object):
|
79
|
80
|
self.callback(queue, *self.args, **self.kwargs)
|
80
|
81
|
|
81
|
82
|
def __lt__(self, other):
|
82
|
|
- return self.priority < other.priority
|
|
83
|
+ if self.priority != other.priority:
|
|
84
|
+ return self.priority < other.priority
|
|
85
|
+ else:
|
|
86
|
+ return self.time < other.time
|
83
|
87
|
|
84
|
88
|
def __init__(self, expire=True):
|
85
|
89
|
self.__expire = expire
|