platypush/bus/__init__.py
def register_handler(self, event_type: Type[Event], handler: Callable[[Event], None]) -> Callable[[], None]:
        """
        Register an event handler to the bus.

        :param event_type: Event type to subscribe (event inheritance also works).
        :param handler: Event handler - a function that takes an Event object as parameter.
        :return: A function that can be called to remove the handler (no parameters required).
        """
        if event_type not in self.event_handlers:
            self.event_handlers[event_type] = set()

        self.event_handlers[event_type].add(handler)

        def unregister():
            self.unregister_handler(event_type, handler)

        return unregister

        Register an event handler to the bus.

        :param event_type: Event type to subscribe (event inheritance also works).
        :param handler: Event handler - a function that takes an Event object as parameter.
        :return: A function that can be called to remove the handler (no parameters required).
        
Register an event handler to the bus.
Register an event handler to the bus .
def register_handler(self, event_type: Type[Event], handler: Callable[[Event], None]) -> Callable[[], None]:
        if event_type not in self.event_handlers:
            self.event_handlers[event_type] = set()
        self.event_handlers[event_type].add(handler)
        def unregister():
            self.unregister_handler(event_type, handler)
        return unregister
def register_handler ( self , event_type : Type [ Event ] , handler : Callable [ [ Event ] , None ] ) -> Callable [ [ ] , None ] : if event_type not in self . event_handlers : self . event_handlers [ event_type ] = set ( ) self . event_handlers [ event_type ] . add ( handler ) def unregister ( ) : self . unregister_handler ( event_type , handler ) return unregister
Register an event handler to the bus.
Register an event handler to the bus .
"""
        Register an event handler to the bus.

        :param event_type: Event type to subscribe (event inheritance also works).
        :param handler: Event handler - a function that takes an Event object as parameter.
        :return: A function that can be called to remove the handler (no parameters required).
        """
A function that can be called to remove the handler (no parameters required).
A function that can be called to remove the handler ( no parameters required ) .
self
event_type
Type[Event]
Event type to subscribe (event inheritance also works).
Event type to subscribe ( event inheritance also works ) .
handler
Callable[[Event], None]
Event handler - a function that takes an Event object as parameter.
Event handler - a function that takes an Event object as parameter .