Пример #1
0
 def _can_write(self):
     self._check_for_exceptions()
     if self._connection.closed:
         raise exceptions.ConnectionClosed()
     elif self.closed:
         raise exceptions.ChannelClosedException()
     return True
Пример #2
0
    def _rpc(self, frame_value):
        """Execute the RPC command for the frame.

        :param pamqp.specification.Frame frame_value: The frame to send
        :rtype: pamqp.specification.Frame or pamqp.message.Message

        """
        if self.channel.closed:
            raise exceptions.ChannelClosedException()
        return self.channel.rpc(frame_value)
Пример #3
0
    def rpc(self, frame_value):
        """Send a RPC command to the remote server.

        :param pamqp.specification.Frame frame_value: The frame to send
        :rtype: pamqp.specification.Frame or None

        """
        if self.closed:
            raise exceptions.ChannelClosedException()
        self._write_frame(frame_value)
        if frame_value.synchronous:
            return self._wait_on_frame(frame_value.valid_responses)
Пример #4
0
    def rpc(self, frame_value):
        """Send a RPC command to the remote server. This should not be directly
        invoked.

        :param pamqp.specification.Frame frame_value: The frame to send
        :rtype: pamqp.specification.Frame or None

        """
        if self.closed:
            raise exceptions.ChannelClosedException()
        if self._is_debugging:
            LOGGER.debug('Sending %r', frame_value.name)
        self.write_frame(frame_value)
        if frame_value.synchronous:
            return self._wait_on_frame(frame_value.valid_responses)