def callback(self, msg, callbacks=None):
        # Try to convert the msg to JSON
        json = None
        try:
            json = message_conversion.extract_values(msg)
        except Exception as exc:
            logerr("Exception while converting messages in subscriber callback : %s", exc)
            return
        
        # Get the callbacks to call
        if not callbacks:
            with self.lock:
                callbacks = self.subscriptions.values()

        # Pass the JSON to each of the callbacks
        for callback in callbacks:
            try:
                callback(json)
            except Exception as exc:
                # Do nothing if one particular callback fails except log it
                logerr("Exception calling subscribe callback: %s", exc)
                pass
Callback for incoming messages on the rospy.Subscriber
dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_library/src/rosbridge_library/internal/subscribers.py/MultiSubscriber.callback