Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Str Assign NameStore Num Assign NameStore Num ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr While CompareLt NameLoad BinOpSub NameLoad NameLoad body Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore NameLoad If AttributeLoad NameLoad attr body Return decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot NameLoad body Assign AttributeStore NameLoad attr BinOpAdd Str AttributeLoad AttributeLoad NameLoad attr attr orelse Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str While UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr TryFinally body Assign TupleStore NameStore NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryExcept body If AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Break TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword Num handlers ExceptHandler type AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Continue If BoolOpOr CompareEq NameLoad NameLoad AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Break Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign TupleStore NameStore NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr ExceptHandler body Expr Call AttributeLoad NameLoad attr Raise finalbody TryFinally body If NameLoad body If CompareEq NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareEq NameLoad AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Raise Call NameLoad Str orelse If UnaryOpNot AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Call NameLoad BinOpMod Str NameLoad Raise AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad Str attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad AttributeLoad NameLoad attr body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad keyword NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad For NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr If NameLoad body Assign NameStore NameLoad orelse Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore AttributeLoad NameLoad attr body Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Num body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str While UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type AttributeLoad NameLoad attr body Pass For NameStore AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr TryFinally body AugAssignAdd AttributeStore NameLoad attr Num finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareGt AttributeLoad NameLoad attr Num body If UnaryOpNot AttributeLoad Call AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad Call AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If BoolOpOr UnaryOpNot NameLoad CompareEq NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareEq NameLoad AttributeLoad NameLoad attr body If CompareGt AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Num Assign NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr TryFinally body If CompareGt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore NameLoad AugAssignAdd AttributeStore NameLoad attr Num finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareEq NameLoad AttributeLoad NameLoad attr body Assign NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr TryFinally body If CompareGt AttributeLoad NameLoad attr Num body Assign NameStore NameLoad AugAssignSub AttributeStore NameLoad attr Num orelse If CompareEq AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr NameLoad orelse AugAssignMult AttributeStore NameLoad attr NameLoad finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A Provides thread-pool-like functionality for workers accessing App Engine.

The pool adapts to slow or timing out requests by reducing the number of
active workers, or increasing the number when requests latency reduces.
 N/A logging N/A Queue N/A sys N/A threading N/A time N/A traceback google.appengine.tools.requeue ReQueue N/A logger N/A N/A logging getLogger google.appengine.tools.adaptive_thread_pool N/A _THREAD_SHOULD_EXIT _THREAD_SHOULD_EXIT N/A INITIAL_BACKOFF 1.0 N/A BACKOFF_FACTOR 2.0 Error N/A Exception N/A N/A Base-class for exceptions in this module. N/A WorkItemError N/A Error N/A N/A Error while processing a WorkItem. N/A RetryException N/A Error N/A N/A A non-fatal exception that indicates that a work item should be retried. N/A InterruptibleSleep N/A N/A sleep_time N/A N/A N/A Puts thread to sleep, checking this threads exit_flag four times a second.

  Args:
    sleep_time: Time to sleep.
   N/A slept 0.0 N/A epsilon 0.0001 N/A thread N/A N/A threading currentThread N/A N/A slept N/A sleep_time epsilon N/A N/A remaining N/A sleep_time slept N/A this_sleep_time N/A min remaining 0.25 N/A N/A N/A time sleep this_sleep_time N/A slept this_sleep_time N/A N/A thread exit_flag N/A N/A N/A WorkerThread N/A N/A threading Thread N/A N/A A WorkerThread to execute WorkItems.

  Attributes:
    exit_flag: A boolean indicating whether this thread should stop
      its work and exit.
   __init__ N/A N/A self thread_pool thread_gate name N/A None N/A N/A Initialize a WorkerThread instance.

    Args:
      thread_pool: An AdaptiveThreadPool instance.
      thread_gate: A ThreadGate instance.
      name: A name for this WorkerThread.
     N/A N/A N/A N/A threading Thread __init__ self N/A N/A N/A self setDaemon True N/A N/A self exit_flag False N/A N/A self __error None N/A N/A self __traceback None N/A N/A self __thread_pool thread_pool N/A N/A self __work_queue N/A thread_pool requeue N/A N/A self __thread_gate thread_gate N/A N/A name N/A N/A N/A self __name N/A Anonymous_ N/A N/A self __class__ __name__ N/A N/A N/A self __name name N/A run N/A N/A self N/A N/A N/A Perform the work of the thread. N/A N/A N/A logger debug [%s] %s: started N/A N/A self getName N/A N/A self __class__ __name__ N/A N/A N/A N/A N/A self WorkOnItems N/A N/A N/A N/A N/A N/A self SetError N/A N/A N/A logger debug [%s] %s: exiting N/A N/A self getName N/A N/A self __class__ __name__ N/A SetError N/A N/A self N/A N/A N/A Sets the error and traceback information for this thread.

    This must be called from an exception handler.
     N/A N/A N/A self __error N/A N/A exc_info N/A N/A sys exc_info N/A N/A self __error N/A exc_info N/A 1 N/A N/A self __traceback N/A exc_info N/A 2 N/A N/A N/A logger exception [%s] %s: N/A N/A self getName N/A N/A self __class__ __name__ N/A WorkOnItems N/A N/A self N/A N/A N/A Perform the work of a WorkerThread. N/A N/A N/A self exit_flag N/A N/A item None N/A N/A N/A N/A self __thread_gate StartWork N/A N/A N/A N/A status instruction N/A N/A WorkItem FAILURE N/A ThreadGate DECREASE N/A N/A N/A N/A self exit_flag N/A N/A instruction N/A ThreadGate HOLD N/A N/A N/A N/A item N/A N/A N/A self __work_queue get block True timeout 1.0 N/A N/A N/A N/A Queue Empty N/A N/A instruction N/A ThreadGate HOLD N/A N/A N/A N/A item _THREAD_SHOULD_EXIT N/A self exit_flag N/A N/A N/A status instruction N/A N/A WorkItem SUCCESS N/A ThreadGate HOLD N/A N/A N/A N/A logger debug [%s] Got work item %s N/A N/A self getName item N/A N/A status instruction N/A N/A item PerformWork N/A self __thread_pool N/A N/A N/A RetryException N/A N/A N/A status instruction N/A N/A WorkItem RETRY N/A ThreadGate HOLD N/A N/A N/A N/A N/A self SetError N/A N/A N/A N/A N/A item N/A N/A N/A status N/A WorkItem SUCCESS N/A N/A N/A N/A N/A self __work_queue task_done N/A N/A N/A status N/A WorkItem RETRY N/A N/A N/A N/A N/A N/A N/A self __work_queue reput item block False N/A N/A N/A N/A Queue Full N/A N/A N/A N/A logger error [%s] Failed to reput work item. N/A N/A self getName N/A N/A Error Failed to reput work item N/A N/A N/A N/A self __error N/A N/A N/A item error N/A N/A N/A self __error N/A item error N/A N/A self __traceback N/A item traceback N/A N/A N/A self __error N/A WorkItemError N/A Fatal error while processing %s item N/A N/A self __error N/A N/A N/A N/A N/A self __thread_gate FinishWork instruction instruction N/A CheckError N/A N/A self N/A N/A N/A If an error is present, then log it. N/A N/A self __error N/A N/A N/A N/A logger error Error in %s: %s N/A N/A self getName N/A self __error N/A N/A self __traceback N/A N/A N/A N/A logger debug %s N/A N/A join N/A N/A traceback format_exception N/A N/A self __error __class__ N/A self __error N/A self __traceback N/A __str__ N/A N/A self N/A N/A N/A N/A self __name N/A N/A AdaptiveThreadPool N/A object N/A N/A A thread pool which processes WorkItems from a queue.

  Attributes:
    requeue: The requeue instance which holds work items for this
      thread pool.
   __init__ N/A N/A self num_threads queue_size base_thread_name worker_thread_factory queue_factory N/A None None WorkerThread N/A Queue Queue N/A N/A Initialize an AdaptiveThreadPool.

    An adaptive thread pool executes WorkItems using a number of
    WorkerThreads.  WorkItems represent items of work that may
    succeed, soft fail, or hard fail. In addition, a completed work
    item can signal this AdaptiveThreadPool to enable more or fewer
    threads.  Initially one thread is active.  Soft failures are
    reqeueud to be retried.  Hard failures cause this
    AdaptiveThreadPool to shut down entirely.  See the WorkItem class
    for more details.

    Args:
      num_threads: The number of threads to use.
      queue_size: The size of the work item queue to use.
      base_thread_name: A string from which worker thread names are derived.
      worker_thread_factory: A factory which procudes WorkerThreads.
      queue_factory: Used for dependency injection.
     N/A N/A queue_size None N/A N/A queue_size num_threads N/A N/A self requeue N/A ReQueue queue_size queue_factory queue_factory N/A N/A self __thread_gate N/A ThreadGate num_threads N/A N/A self __num_threads num_threads N/A N/A self __threads N/A N/A i N/A xrange num_threads N/A N/A thread N/A worker_thread_factory self N/A self __thread_gate N/A base_thread_name N/A N/A base base_thread_name N/A N/A base N/A N/A thread __class__ __name__ N/A N/A thread name N/A %s-%d N/A base i N/A N/A N/A N/A self __threads append thread N/A N/A N/A thread start N/A num_threads N/A N/A self N/A N/A N/A Return the number of threads in this thread pool. N/A N/A self __num_threads N/A Threads N/A N/A self N/A N/A N/A Yields the registered threads. N/A thread N/A self __threads N/A N/A N/A thread N/A SubmitItem N/A N/A self item block timeout N/A True 0.0 N/A N/A Submit a WorkItem to the AdaptiveThreadPool.

    Args:
      item: A WorkItem instance.
      block: Whether to block on submitting if the submit queue is full.
      timeout: Time wait for room in the queue if block is True, 0.0 to
        block indefinitely.

    Raises:
      Queue.Full if the submit queue is full.
     N/A N/A N/A N/A self requeue put item block block timeout timeout N/A QueuedItemCount N/A N/A self N/A N/A N/A Returns the number of items currently in the queue. N/A N/A N/A N/A self requeue qsize N/A Shutdown N/A N/A self N/A N/A N/A Shutdown the thread pool.

    Tasks may remain unexecuted in the submit queue.
     N/A N/A N/A N/A N/A self requeue empty N/A N/A N/A N/A unused_item N/A N/A N/A self requeue get_nowait N/A N/A N/A N/A self requeue task_done N/A N/A N/A N/A Queue Empty N/A N/A N/A thread N/A self __threads N/A N/A N/A thread exit_flag True N/A N/A N/A N/A self requeue put _THREAD_SHOULD_EXIT N/A N/A N/A N/A self __thread_gate EnableAllThreads N/A Wait N/A N/A self N/A N/A N/A Wait until all work items have been completed. N/A N/A N/A N/A self requeue join N/A JoinThreads N/A N/A self N/A N/A N/A Wait for all threads to exit. N/A thread N/A self __threads N/A N/A N/A N/A logger debug N/A Waiting for %s to exit N/A str thread N/A N/A N/A thread join N/A CheckErrors N/A N/A self N/A N/A N/A Output logs for any errors that occurred in the worker threads. N/A thread N/A self __threads N/A N/A N/A N/A thread CheckError N/A N/A ThreadGate N/A object N/A N/A Manage the number of active worker threads.

  The ThreadGate limits the number of threads that are simultaneously
  active in order to implement adaptive rate control.

  Initially the ThreadGate allows only one thread to be active.  For
  each successful work item, another thread is activated and for each
  failed item, the number of active threads is reduced by one.  When only
  one thread is active, failures will cause exponential backoff.

  For example, a ThreadGate instance, thread_gate can be used in a number
  of threads as so:

  # Block until this thread is enabled for work.
  thread_gate.StartWork()
  try:
    status = DoSomeWorkInvolvingLimitedSharedResources()
    succeeded = IsStatusGood(status)
    badly_failed = IsStatusVeryBad(status)
  finally:
    if succeeded:
      # Succeeded, add more simultaneously enabled threads to the task.
      thread_gate.FinishWork(instruction=ThreadGate.INCREASE)
    elif badly_failed:
      # Failed, or succeeded but with high resource load, reduce number of
      # workers.
      thread_gate.FinishWork(instruction=ThreadGate.DECREASE)
    else:
      # We succeeded, but don't want to add more workers to the task.
      thread_gate.FinishWork(instruction=ThreadGate.HOLD)

  the thread_gate will enable and disable/backoff threads in response to
  resource load conditions.

  StartWork can block indefinitely. FinishWork, while not
  lock-free, should never block absent a demonic scheduler.
   N/A INCREASE increase N/A HOLD hold N/A DECREASE decrease __init__ N/A N/A self num_threads sleep N/A InterruptibleSleep N/A N/A Constructor for ThreadGate instances.

    Args:
      num_threads: The total number of threads using this gate.
      sleep: Used for dependency injection.
     N/A N/A self __enabled_count 1 N/A N/A self __lock N/A N/A threading Lock N/A N/A self __thread_semaphore N/A N/A threading Semaphore N/A self __enabled_count N/A N/A self __num_threads num_threads N/A N/A self __backoff_time 0 N/A N/A self __sleep sleep N/A num_threads N/A N/A self N/A N/A N/A N/A self __num_threads N/A EnableThread N/A N/A self N/A N/A N/A Enable one more worker thread. N/A N/A N/A N/A self __lock acquire N/A N/A N/A N/A self __enabled_count 1 N/A N/A N/A N/A N/A self __lock release N/A N/A N/A N/A self __thread_semaphore release N/A EnableAllThreads N/A N/A self N/A N/A N/A Enable all worker threads. N/A unused_idx N/A xrange N/A N/A self __num_threads N/A self __enabled_count N/A N/A N/A N/A self EnableThread N/A StartWork N/A N/A self N/A N/A N/A Starts a critical section in which the number of workers is limited.

    Starts a critical section which allows self.__enabled_count
    simultaneously operating threads. The critical section is ended by
    calling self.FinishWork().
     N/A N/A N/A N/A self __thread_semaphore acquire N/A N/A N/A self __backoff_time 0.0 N/A N/A N/A N/A N/A N/A threading currentThread exit_flag N/A N/A N/A N/A logger info [%s] Backing off due to errors: %.1f seconds N/A N/A N/A N/A threading currentThread getName N/A self __backoff_time N/A N/A N/A self __sleep N/A self __backoff_time N/A FinishWork N/A N/A self instruction N/A None N/A N/A Ends a critical section started with self.StartWork(). N/A N/A N/A instruction N/A instruction N/A ThreadGate HOLD N/A N/A N/A N/A N/A self __thread_semaphore release N/A N/A N/A instruction N/A ThreadGate INCREASE N/A N/A N/A N/A self __backoff_time 0.0 N/A N/A N/A N/A logger info Resetting backoff to 0.0 N/A N/A self __backoff_time 0.0 N/A do_enable False N/A N/A N/A N/A self __lock acquire N/A N/A N/A N/A N/A self __num_threads N/A self __enabled_count N/A N/A do_enable True N/A N/A self __enabled_count 1 N/A N/A N/A N/A N/A self __lock release N/A do_enable N/A N/A N/A N/A logger debug Increasing active thread count to %d N/A self __enabled_count N/A N/A N/A N/A self __thread_semaphore release N/A N/A N/A N/A self __thread_semaphore release N/A N/A N/A instruction N/A ThreadGate DECREASE N/A N/A do_disable False N/A N/A N/A N/A self __lock acquire N/A N/A N/A N/A N/A self __enabled_count 1 N/A N/A do_disable True N/A N/A self __enabled_count 1 N/A N/A N/A N/A self __backoff_time 0.0 N/A N/A N/A self __backoff_time INITIAL_BACKOFF N/A N/A N/A self __backoff_time BACKOFF_FACTOR N/A N/A N/A N/A N/A self __lock release N/A do_disable N/A N/A N/A N/A logger debug Decreasing the number of active threads to %d N/A self __enabled_count N/A N/A N/A N/A N/A self __thread_semaphore release N/A N/A WorkItem N/A object N/A N/A Holds a unit of work. N/A SUCCESS success N/A RETRY retry N/A FAILURE failure __init__ N/A N/A self name N/A N/A N/A N/A self __name name N/A PerformWork N/A N/A self thread_pool N/A N/A N/A Perform the work of this work item and report the results.

    Args:
      thread_pool: The AdaptiveThreadPool instance associated with this
        thread.

    Returns:
      A tuple (status, instruction) of the work status and an instruction
      for the ThreadGate.
     N/A NotImplementedError N/A __str__ N/A N/A self N/A N/A N/A N/A self __name N/A N/A