示例#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)