Called when the server acknowledges a cancel request.

        Args:
            cancel_frame (pika.spec.Basic.CancelOk): The cancelok frame from
                the server.
349824
def _on_cancelok(self, cancel_frame):
        
        _log.info("Consumer canceled; returning all unprocessed messages to the queue")
        self._channel.basic_nack(delivery_tag=0, multiple=True, requeue=True)
90331
def abort(self, frame):
        
        if not frame.transaction:
            raise ProtocolError("Missing transaction for ABORT command.")

        if not frame.transaction in self.engine.transactions:
            raise ProtocolError("Invalid transaction: %s" % frame.transaction)

        self.engine.queue_manager.resend_transaction_frames(
            self.engine.connection, frame.transaction)
        del self.engine.transactions[frame.transaction]
91108
async def handle_frame(self, frame):
        """"""
        if isinstance(frame, FrameCommandSendConfirmation) and frame.session_id == self.session_id:
            if frame.status == CommandSendConfirmationStatus.ACCEPTED:
                self.success = True
            return not self.wait_for_completion
        if isinstance(frame, FrameCommandRemainingTimeNotification) and frame.session_id == self.session_id:
            # Ignoring FrameCommandRemainingTimeNotification
            return False
        if isinstance(frame, FrameCommandRunStatusNotification) and frame.session_id == self.session_id:
            # At the moment I don't reall understand what the FrameCommandRunStatusNotification is good for.
            # Ignoring these packets for now
            return False
        if isinstance(frame, FrameSessionFinishedNotification) and frame.session_id == self.session_id:
            return True
        return False
1313217
def on_evaluate_request(self, py_db, request):
        '''
        
        '''
        # : :type arguments: EvaluateArguments
        arguments = request.arguments

        thread_id = py_db.suspended_frames_manager.get_thread_id_for_variable_reference(
            arguments.frameId)

        self.api.request_exec_or_evaluate_json(
            py_db, request, thread_id)
1160488
function() {
    var root = this;
    var manager = root.__manager__;
    if (manager.rafID != null) {
      root.cancelAnimationFrame(manager.rafID);
    }
  }
531726
def _publish_confirm(self, frames_out):
        
        confirm_uuid = self._channel.rpc.register_request(['Basic.Ack',
                                                           'Basic.Nack'])
        self._channel.write_frames(frames_out)
        result = self._channel.rpc.get_request(confirm_uuid, raw=True)
        self._channel.check_for_errors()
        if isinstance(result, specification.Basic.Ack):
            return True
        return False
1135538
def notify(self, frame_type, headers=None, body=None):
        
        if frame_type == 'receipt':
            # logic for wait-on-receipt notification
            receipt = headers['receipt-id']
            receipt_value = self.__receipts.get(receipt)
            with self.__send_wait_condition:
                self.set_receipt(receipt, None)
                self.__send_wait_condition.notify()

            if receipt_value == CMD_DISCONNECT:
                self.set_connected(False)
                # received a stomp 1.1+ disconnect receipt
                if receipt == self.__disconnect_receipt:
                    self.disconnect_socket()
                self.__disconnect_receipt = None

        elif frame_type == 'connected':
            self.set_connected(True)

        elif frame_type == 'disconnected':
            self.set_connected(False)

        with self.__listeners_change_condition:
            listeners = sorted(self.listeners.items())

        for (_, listener) in listeners:
            if not listener:
                continue

            notify_func = getattr(listener, 'on_%s' % frame_type, None)
            if not notify_func:
                log.debug("listener %s has no method on_%s", listener, frame_type)
                continue
            if frame_type in ('heartbeat', 'disconnected'):
                notify_func()
                continue
            if frame_type == 'connecting':
                notify_func(self.current_host_and_port)
                continue

            if frame_type == 'error' and not self.connected:
                with self.__connect_wait_condition:
                    self.connection_error = True
                    self.__connect_wait_condition.notify()

            rtn = notify_func(headers, body)
            if rtn:
                (headers, body) = rtn
        return (headers, body)
1162867
def cancelUpdate(self):
        
        key = '/library/sections/%s/refresh' % self.key
        self._server.query(key, method=self._server._session.delete)
608078
def cancel(self, block=True):
        
        if self._consumer:
            self._consumer.cancel(block=block)
679889
def on_consumer_cancelled(self, method_frame):
        
        _logger.info('Consumer was cancelled remotely, shutting down: %r', method_frame)
        if self._channel:
            self._channel.close()
65450
def on_consumer_cancelled(self, method_frame):
        
        msg = 'Consumer was cancelled remotely, shutting down: {0!r}'
        logger.info(msg.format(method_frame))
        if self._channel:
            self._channel.close()
192757
def abort_request(self, request):
        """"""
        self.timedout = True
        try:
            request.cancel()
        except error.AlreadyCancelled:
            return
632008
async def cancel_handler(message: types.Message, state: FSMContext, raw_state: Optional[str] = None):
    
    if raw_state is None:
        return

    # Cancel state and inform user about it
    await state.finish()
    # And remove keyboard (just in case)
    await message.reply('Canceled.', reply_markup=types.ReplyKeyboardRemove())
641137
public void cancelRequest(long ticketNumber) {
    if (this.session != null
        && this.outstandingRequests.containsKey(Long.valueOf(ticketNumber))) {
      CancelRequestMessage message = new CancelRequestMessage();
      message.setTicketNumber(ticketNumber);
      this.session.write(message);
    } else {
      log.warn("Tried to cancel unknown request for ticket number {}.",
          Long.valueOf(ticketNumber));
    }
  }
133101
def cancel(self):
        
        if self.cancelled:
            raise error.AlreadyCancelled
        elif self.called:
            raise error.AlreadyCalled
        else:
            self.canceller(self)
            self.cancelled = 1
            if self.debug:
                self._str = str(self)
            del self.func, self.args, self.kw
385882
def _on_queue_declareok(self, frame):
        
        _log.info("Successfully declared the %s queue", frame.method.queue)
        for binding in self._bindings:
            if binding["queue"] == frame.method.queue:
                for key in binding["routing_keys"]:
                    _log.info(
                        "Asserting %s is bound to %s with the %s key",
                        binding["queue"],
                        binding["exchange"],
                        key,
                    )
                    self._channel.queue_bind(
                        callback=None,
                        queue=binding["queue"],
                        exchange=binding["exchange"],
                        routing_key=key,
                    )
                bc_args = dict(queue=frame.method.queue)
                if _pika_version < pkg_resources.parse_version("1.0.0b1"):
                    bc_args["consumer_callback"] = self._on_message
                else:
                    bc_args["on_message_callback"] = self._on_message
                tag = self._channel.basic_consume(**bc_args)
                self._consumers[tag] = binding["queue"]
912084
def process_frame(self, f, frame_str):
        
        frame_type = f.cmd.lower()

        if frame_type in ['disconnect']:
            return

        if frame_type == 'send':
            frame_type = 'message'
            f.cmd = 'MESSAGE'

        if frame_type in ['connected', 'message', 'receipt', 'error', 'heartbeat']:
            if frame_type == 'message':
                if f.headers['destination'] not in self.subscriptions.values():
                    return
                (f.headers, f.body) = self.notify('before_message', f.headers, f.body)
            self.notify(frame_type, f.headers, f.body)
        if 'receipt' in f.headers:
            receipt_frame = Frame('RECEIPT', {'receipt-id': f.headers['receipt']})
            lines = convert_frame(receipt_frame)
            self.send(encode(pack(lines)))
        log.debug("Received frame: %r, headers=%r, body=%r", f.cmd, f.headers, f.body)