platypush/event/__init__.py
def fire_event(self, event):
        """
        Fires an event (instance of :class:`platypush.message.event.Event` or a
            subclass) to the internal bus and triggers any handler callback
            associated to the event type or any of its super-classes.

        :param event: Event to fire
        :type event: :class:`platypush.message.event.Event` or a subclass
        """

        def hndl_thread(handler):
            handler(event)

        from platypush.backend import Backend
        from platypush.context import get_bus

        bus = self.bus if isinstance(self, Backend) else get_bus()
        if not bus:
            self.logger.warning('No bus available to post the event: {}'.format(event))
        else:
            bus.post(event)

        handlers = set()

        for cls in inspect.getmro(event.__class__):
            if cls in self._event_handlers:
                handlers.update(self._event_handlers[cls])

        for hndl in handlers:
            threading.Thread(target=hndl_thread, args=(hndl,)).start()

        Fires an event (instance of :class:`platypush.message.event.Event` or a
            subclass) to the internal bus and triggers any handler callback
            associated to the event type or any of its super-classes.

        :param event: Event to fire
        :type event: :class:`platypush.message.event.Event` or a subclass
        
Fires an event (instance of :class:`platypush.message.event.Event` or a
subclass) to the internal bus and triggers any handler callback
associated to the event type or any of its super-classes.
Fires an event ( instance of : class : ` platypush . message . event . Event ` or a subclass ) to the internal bus and triggers any handler callback associated to the event type or any of its super - classes .
def fire_event(self, event):
        def hndl_thread(handler):
            handler(event)
        from platypush.backend import Backend
        from platypush.context import get_bus
        bus = self.bus if isinstance(self, Backend) else get_bus()
        if not bus:
            self.logger.warning('No bus available to post the event: {}'.format(event))
        else:
            bus.post(event)
        handlers = set()
        for cls in inspect.getmro(event.__class__):
            if cls in self._event_handlers:
                handlers.update(self._event_handlers[cls])
        for hndl in handlers:
            threading.Thread(target=hndl_thread, args=(hndl,)).start()
def fire_event ( self , event ) : def hndl_thread ( handler ) : handler ( event ) from platypush . backend import Backend from platypush . context import get_bus bus = self . bus if isinstance ( self , Backend ) else get_bus ( ) if not bus : self . logger . warning ( 'No bus available to post the event: {}' . format ( event ) ) else : bus . post ( event ) handlers = set ( ) for cls in inspect . getmro ( event . __class__ ) : if cls in self . _event_handlers : handlers . update ( self . _event_handlers [ cls ] ) for hndl in handlers : threading . Thread ( target = hndl_thread , args = ( hndl , ) ) . start ( )
Fires an event (instance of :class:`platypush.message.event.Event` or a
subclass) to the internal bus and triggers any handler callback
associated to the event type or any of its super-classes.
Fires an event ( instance of : class : ` platypush . message . event . Event ` or a subclass ) to the internal bus and triggers any handler callback associated to the event type or any of its super - classes .
"""
        Fires an event (instance of :class:`platypush.message.event.Event` or a
            subclass) to the internal bus and triggers any handler callback
            associated to the event type or any of its super-classes.

        :param event: Event to fire
        :type event: :class:`platypush.message.event.Event` or a subclass
        """
self
event
Event to fire
Event to fire