Package proton :: Module reactor :: Class EventInjector
[frames] | no frames]

Class EventInjector

source code


Can be added to a reactor to allow events to be triggered by an external thread but handled on the event thread associated with the reactor. An instance of this class can be passed to the Reactor.selectable() method of the reactor in order to activate it. The close() method should be called when it is no longer needed, to allow the event loop to end if needed.

Instance Methods
 
__init__(self) source code
 
trigger(self, event)
Request that the given event be dispatched on the event thread of the reactor to which this EventInjector was added.
source code
 
close(self)
Request that this EventInjector be closed.
source code
 
fileno(self) source code
 
on_selectable_init(self, event) source code
 
on_selectable_readable(self, event) source code
Method Details

__init__(self)
(Constructor)

source code 
Overrides: object.__init__
(inherited documentation)

close(self)

source code 

Request that this EventInjector be closed. Existing events will be dispctahed on the reactors event dispactch thread, then this will be removed from the set of interest.