Handle a cancel notification from the client.
558369
def _handle_cancel_notification(self, msg_id):
        """"""
        request_future = self._client_request_futures.pop(msg_id, None)

        if not request_future:
            log.warn("Received cancel notification for unknown message id %s", msg_id)
            return

        # Will only work if the request hasn't started executing
        if request_future.cancel():
            log.debug("Cancelled request with id %s", msg_id)
208731
def handleNotification(self, req):
        """"""
        name = req["method"]
        params = req["params"]
        try: #to get a callable obj 
            obj = getMethodByName(self.service, name)
            rslt = obj(*params)
        except:
            pass
133298
def _function_handler(function, args, kwargs, future):
    """"""
    future.set_running_or_notify_cancel()

    try:
        result = function(*args, **kwargs)
    except BaseException as error:
        error.traceback = format_exc()
        future.set_exception(error)
    else:
        future.set_result(result)
222650
def cancel(self):
        
        if self._running:
            self.interrupt()
            self._running = False
            self._cancelled = True
            self.loadingFinished.emit()
1359634
async def cancel(self):
        """"""
        self.is_cancelled = True
        if self.future is not None:
            self.future.cancel()
        if self.task_process is not None:
            log.warning("Worker is shutting down, but a task is running. Terminating task")
            await self.task_process.worker_shutdown_stop()
918294
def _cancel(self, msgId):
        
        _, canceller = self._requests.pop(msgId, (None, None))

        if canceller is not None and canceller.active():
            canceller.cancel()
124314
private void handleInCancellingState(final SipPacket msg) throws SipPacketParseException {

        // we don't move over to cancelled state even if
        // we receive a 200 OK to the cancel request.
        // therefore, not even checking it...
        if (msg.isCancel()) {
            transition(CallState.CANCELLING, msg);
            return;
        }

        if (msg.isRequest()) {

        } else {
            final SipResponsePacket response = msg.toResponse();
            if (response.isInvite()) {
                if (response.getStatus() == 487) {
                    transition(CallState.CANCELLED, msg);
                } else if (response.isSuccess()) {
                    // the cancel didn't make it over in time
                    // so we never cancelled, hence we move
                    // to in call
                    transition(CallState.IN_CALL, msg);
                }
            }

        }

    }
337368
private void notifyOnCanceled() {
        for (Listener<DataType, KeyType, ViewType, ParamType> listener : listeners) {
            listener.onCanceled(this);
        }
    }
239245
def handle_data(self, data):
        """"""
        if 'id' in data:
            self.handle_response(data)
        else:
            self.handle_notification(data)
480684
def _basic_cancel_notify(self, args):
        
        consumer_tag = args.read_shortstr()
        callback = self._on_cancel(consumer_tag)
        if callback:
            callback(consumer_tag)
        else:
            raise ConsumerCancelled(consumer_tag, (60, 30))
1177181
function cancel(opt_reason) {
    if (!isPending()) {
      return;
    }

    if (opt_canceller) {
      opt_reason = opt_canceller(opt_reason) || opt_reason;
    }

    reject(opt_reason);
  }
484347
def handle_cancel(self, **kwargs):
        '''
        '''
        for func in self._cancel_functions:
            f_args = getargspec(func)[0]
            f_kwargs = {key: kwargs[key] for key in f_args if key in kwargs}
            func(**f_kwargs)
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)
735751
static function dismiss() {
		check_ajax_referer( (string) __CLASS__, 'nonce' );

		$id      = isset( $_POST['id'] ) ? sanitize_text_field( $_POST['id'] ) : '';
		$confirm = isset( $_POST['confirm'] ) ? sanitize_text_field( $_POST['confirm'] ) : 'no';

		if ( empty( $id ) ) {
			wp_send_json( [] );
		}
		self::set_last_active_notification_timestamp();
		update_option( $id, $confirm );
		do_action( $id . '_process_confirm', $confirm );
		wp_send_json( [] );
	}
1332706
async def cancel(self):
        
        if self._cancel_done:
            raise ProtocolError('Stream was already cancelled')

        with self._wrapper:
            await self._stream.reset()  # TODO: specify error code
            self._cancel_done = True
403397
def abort(self, err):
        """"""
        if _debug: IOGroup._debug("abort %r", err)

        # change the state to reflect that it was killed
        self.ioState = ABORTED
        self.ioError = err

        # abort all the members
        for iocb in self.ioMembers:
            iocb.abort(err)

        # notify the client
        self.trigger()
178787
def action_cancel(self):
        """"""
        self.write({'state': 'cancelled'})
        for rec in self:
            rec.message_post(
                subtype='mt_comment',
                body=_(
                    'Change request <b>%s</b> has been cancelled by %s.'
                    ) % (rec.display_name, self.env.user.name)
                )