예제 #1
0
 def __init__(self):
     self._last_dump_time = time.time()
     self.on_before_batch_flush = core_events.EventHook()
     self.on_after_batch_flush = core_events.EventHook()
     thread = threading.current_thread()
     thread_name = thread.name if thread.name else str(thread.ident)
     if '_state' in globals():
         _state.last_id += 1
         _id = _state.last_id
     else:
         _id = 0
     self.name = '%s / %d' % (thread_name, _id)
     self.reset()
예제 #2
0
파일: scheduler.py 프로젝트: tomtung/asynq
 def __init__(self):
     self._last_dump_time = time.time()
     self._empty_set = set()  # Just a perf. optimization
     self.await_recursion_depth = 0
     self.max_await_recursion_depth = MAX_AWAIT_RECURSION_DEPTH
     self.on_before_batch_flush = core_events.EventHook()
     self.on_after_batch_flush = core_events.EventHook()
     self.reset()
     thread = threading.current_thread()
     thread_name = thread.name if thread.name else str(thread.ident)
     if '_state' in globals():
         _state.last_id += 1
         _id = _state.last_id
     else:
         _id = 0
     self.name = '%s / %d' % (thread_name, _id)
예제 #3
0
 def __init__(self):
     self._value = _none
     self._error = None
     self._in_repr = False
     self.on_computed = core_events.EventHook()