Package portage :: Package util :: Package _async :: Module AsyncScheduler :: Class AsyncScheduler
[hide private]

Class AsyncScheduler

source code

                           object --+        
                                    |        
                SlotObject.SlotObject --+    
                                        |    
_emerge.AsynchronousTask.AsynchronousTask --+
                                            |
                               object --+   |
                                        |   |
      _emerge.PollScheduler.PollScheduler --+
                                            |
                                           AsyncScheduler
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, max_jobs=None, max_load=None, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_poll(self) source code
 
_cancel(self)
Subclasses should implement this, as a template method to be called by AsynchronousTask.cancel().
source code
 
_terminate_tasks(self)
Send signals to terminate all tasks.
source code
 
_next_task(self) source code
bool
_keep_scheduling(self)
Returns: True if there may be remaining tasks to schedule, False otherwise.
source code
 
_running_job_count(self) source code
 
_schedule_tasks(self)
This is called from inside the _schedule() method, which guarantees the following:
source code
 
_task_exit(self, task) source code
 
_start(self) source code
 
_wait(self) source code

Inherited from _emerge.AsynchronousTask.AsynchronousTask: addExitListener, addStartListener, cancel, isAlive, poll, removeExitListener, removeStartListener, start, wait

Inherited from SlotObject.SlotObject: copy

Inherited from _emerge.PollScheduler.PollScheduler: terminate

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
Properties [hide private]

Inherited from _emerge.AsynchronousTask.AsynchronousTask: background, cancelled, returncode

Inherited from object: __class__

Method Details [hide private]

__init__(self, max_jobs=None, max_load=None, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • main - If True then use global_event_loop(), otherwise use a local EventLoop instance (default is False, for safe use in a non-main thread)
Overrides: object.__init__
(inherited documentation)

_poll(self)

source code 
Overrides: _emerge.AsynchronousTask.AsynchronousTask._poll

_cancel(self)

source code 

Subclasses should implement this, as a template method to be called by AsynchronousTask.cancel().

Overrides: _emerge.AsynchronousTask.AsynchronousTask._cancel
(inherited documentation)

_terminate_tasks(self)

source code 

Send signals to terminate all tasks. This is called once from _keep_scheduling() or _is_work_scheduled() in the event dispatching thread. It will not be called while the _schedule_tasks() implementation is running, in order to avoid potential interference. All tasks should be cleaned up at the earliest opportunity, but not necessarily before this method returns. Typically, this method will send kill signals and return without waiting for exit status. This allows basic cleanup to occur, such as flushing of buffered output to logs.

Overrides: _emerge.PollScheduler.PollScheduler._terminate_tasks
(inherited documentation)

_keep_scheduling(self)

source code 
Returns: bool
True if there may be remaining tasks to schedule, False otherwise.
Overrides: _emerge.PollScheduler.PollScheduler._keep_scheduling
(inherited documentation)

_running_job_count(self)

source code 
Overrides: _emerge.PollScheduler.PollScheduler._running_job_count

_schedule_tasks(self)

source code 

This is called from inside the _schedule() method, which
guarantees the following:

1) It will not be called recursively.
2) _terminate_tasks() will not be called while it is running.
3) The state of the boolean _terminated_tasks variable will
   not change while it is running.

Unless this method is used to perform user interface updates,
or something like that, the first thing it should do is check
the state of _terminated_tasks and if that is True then it
should return immediately (since there's no need to
schedule anything after _terminate_tasks() has been called).

Overrides: _emerge.PollScheduler.PollScheduler._schedule_tasks
(inherited documentation)

_start(self)

source code 
Overrides: _emerge.AsynchronousTask.AsynchronousTask._start

_wait(self)

source code 
Overrides: _emerge.AsynchronousTask.AsynchronousTask._wait