Package proton :: Module reactor :: Class EventInjector

[frames] | no frames]

# Class EventInjector

source code

    object --+
             |
            EventInjector

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) x.__init__(...) initializes x; see help(type(x)) for signature | 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

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

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self)
(Constructor)

source code

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

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.