code: def on_state_changed(self, previous_state, new_state):
          
          # pylint: disable=protected-access
          _logger.info("Message receiver %r state changed from %r to %r on connection: %r",
                       self.name, previous_state, new_state, self._session._connection.container_id)
          self._state = new_state
docs: Callback called whenever the underlying Receiver undergoes a change
          of state. This function can be overridden.
  
          :param previous_state: The previous Receiver state.
          :type previous_state: ~uamqp.constants.MessageReceiverState
          :param new_state: The new Receiver state.
          :type new_state: ~uamqp.constants.MessageReceiverState