def _on_msg_touchpad_created(self): """ Called when a device has registerd a new websocket """ def dispatch(): self._controller.on_device_touchpad_created( connection_id=self._connection_id, ) player.callFromThread(dispatch)
def dispatch(self, event_name, **kwargs): """ Allows that this dispatch will be in the main thread rather than in the sever thread. """ # Create a "worker" for the libavg thread. def inner_dispatch(): super(TornadoServer, self).dispatch(event_name, **kwargs) player.callFromThread(inner_dispatch)
def _on_msg_touchupdate(self, data): """ Called when a device has registered a touchup or touchdown event """ def dispatch(): self._controller.on_device_touchpad_event( connection_id=self._connection_id, update_type=data["updateType"] ) player.callFromThread(dispatch)
def threadFunc(): player.callFromThread(onAsyncCall)