Set the message callback.

def msg_callback(self, callback):
        """Set the message callback."""
        if callable(callback):
            self._msg_callback = callback
        else:
            self._msg_callback = None