Package coro :: Module _coro :: Class coro
[hide private]
[frames] | no frames]

Class coro

object --+
         |
        coro

XXX
Instance Methods [hide private]
 
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__repr__(x)
repr(x)
 
_resume(...)
 
_yield(...)
 
getName(...)
 
get_frame(...)
 
get_name(...)
Get the name of this coroutine thread.
 
interrupt(...)
 
join(...)
Wait for thread termination.
 
raise_exception(...)
Schedule this coroutine to resume with an exception.
 
resume_with_exc(...)
 
schedule(...)
Schedule this coroutine to run.
 
setName(...)
 
set_max_selfish_acts(...)
Set the maximum number of selfish acts this coroutine is allowed to perform.
 
set_name(...)
Set the name of this coroutine thread.
 
shutdown(...)
Shut down this coroutine.
 
start(...)
Start the coroutine for the first time.
 
thread_id(...)

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

Instance Variables [hide private]
  top
: A call_stack object used by the profiler.
Properties [hide private]
  dead
  id
  name
  scheduled
  started
  value

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

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

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__repr__(x)
(Representation operator)

 
repr(x)
Overrides: object.__repr__

get_name(...)

 

Get the name of this coroutine thread.

If no name has been specified, then a name is generated.

Returns:
Returns the coroutine name.

join(...)

 

Wait for thread termination.

This will wait for this thread to exit. If the thread has already exited, this will return immediately.

Warning: If a thread is created, but never started, this function will block forever.

raise_exception(...)

 
Schedule this coroutine to resume with an exception.
Parameters:
  • the_exception - : The exception to raise. May be an Exception class or instance.
  • force - : If True, will force the exception to be raised, even if the coroutine is already scheduled. Defaults to True.
  • cancel_start - : If True, will cancel the coroutine if it has not started, yet. If False, and the couroutine has not started, then it will rise NotStartedError. Defaults to False.
Raises:
  • DeadCoroutine - : The coroutine is dead (it has already exited).
  • ScheduleError - : The coroutine is already scheduled to run (and force was set to False).
  • ScheduleError - : Attempted to raise an exception on the currently running coro.
  • NotStartedError - : The coroutine has not started, yet.

schedule(...)

 
Schedule this coroutine to run.
Parameters:
  • value - : The value to resume the coroutine with. Defaults to None.
Raises:
  • DeadCoroutine - : The coroutine is dead (it has already exited).
  • ScheduleError - : The coroutine is already scheduled to run.
  • ScheduleError - : Attempted to schedule the currently running coro.

set_max_selfish_acts(...)

 

Set the maximum number of selfish acts this coroutine is allowed to perform.

When a coroutine is created, it defaults to 4.

Parameters:
  • maximum - : The maximum number of selfish acts.

set_name(...)

 
Set the name of this coroutine thread.
Parameters:
  • name - : The name of the thread.

shutdown(...)

 

Shut down this coroutine.

This will raise the Shutdown exception on this thread.

This method will not fail. If the thread is already dead, then it is ignored. If the thread hasn't started, then it is canceled.

start(...)

 
Start the coroutine for the first time.
Raises:

Instance Variable Details [hide private]

top

: A call_stack object used by the profiler. NULL if the profiler is not enabled or if this is the first call of the coroutine.