コード例 #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()