Package tangled :: Module core :: Class Reactor
[hide private]
[frames] | no frames]

Class Reactor

source code

object --+
         |
        Reactor

The reactor is the engine of your asynchronous application.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
wake(self)
Uses the trigger to wake the async loop
source code
 
run_in_main(self, func)
Wakes the async loop, and calls func in it
source code
Deferred
defer_to_worker(self, func, worker)
Calls a function in a worker, and return the result as a Deferred
source code
 
call_later(self, func, timeout)
Call a function at a later time in the main loop
source code
 
_timeout(self) source code
 
loop(self) source code

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

Class Variables [hide private]
  _trigger = Trigger()
  use_poll = False
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

run_in_main(self, func)

source code 

Wakes the async loop, and calls func in it

Parameters:
  • func - The function to call from the main loop

defer_to_worker(self, func, worker)

source code 

Calls a function in a worker, and return the result as a Deferred

Parameters:
  • func - The function to call in the worker
  • worker (Worker) - The worker that should handle the call
Returns: Deferred
A Deferred objeft that will eventually contain the result

call_later(self, func, timeout)

source code 

Call a function at a later time in the main loop

Parameters:
  • func - The function to call
  • timeout - How long (in seconds) to the call shall be made