Register a callback function to receive QAPI Unsolicited (resource) RENAMED. The
        callback receives a single argument - the inner message. If `serialised` is not set,
        the callbacks might arrive out-of-order.
162262
def register_callback_renamed(self, func, serialised=True):
        
        self.__add_callback(_CB_RENAMED, func, serialised_if_crud=serialised)
268108
function AddCallback(mesgId, callbackFunction, callbackTimeout) {
    var callbackElement, now;

    now = new Date().getTime();

    callbackElement = {
        id      :   mesgId,
        func    :   callbackFunction,
        timeout :   now + callbackTimeout
    };

    callbackList.push(callbackElement);
}
301459
function callApi (method) {
  return function (req, res) {
    var apiAction = api[method](req.guid, req.options)
    handleResponse(apiAction, res)
  }
}
1246032
function serializeCallback(args) {
  var callback;

  debug('Transforming callback in ', args);

  return args.map(function(arg) {
    if (typeof arg !== 'function') return arg;

    // It shouldn't be an argument after the callback function
    invariant(!callback, 'Only one callback function is allowed.');

    callback = arg;

    return '__clientCallback__';
  });
}
144999
async def trigger_callback(self, sid, namespace, id, data):
        
        callback = None
        try:
            callback = self.callbacks[sid][namespace][id]
        except KeyError:
            # if we get an unknown callback we just ignore it
            self._get_logger().warning('Unknown callback received, ignoring.')
        else:
            del self.callbacks[sid][namespace][id]
        if callback is not None:
            ret = callback(*data)
            if asyncio.iscoroutine(ret):
                try:
                    await ret
                except asyncio.CancelledError:  # pragma: no cover
                    pass
408026
def callback(self, herald_svc, message):
        
        if self.__callback is not None:
            try:
                # pylint: disable=W0703
                self.__callback(herald_svc, message)
            except Exception as ex:
                _logger.exception("Error calling callback: %s", ex)
1156892
def register(**kwargs):
    
    def decorator(func):
        _CALL_REGISTRY[kwargs.get(API_SYM, func.__name__)] = func
        return func

    return decorator
877661
def __add_callback(self, type_, func, serialised_if_crud=True):
        """"""
        Validation.callable_check(func)
        with self.__callbacks:
            self.__callbacks[type_].append((func, serialised_if_crud))
1037455
def callback(self, callback, *args, **kwds):
        
        _exit_wrapper = self._create_cb_wrapper(callback, *args, **kwds)

        # We changed the signature, so using @wraps is not appropriate, but
        # setting __wrapped__ may still help with introspection.
        _exit_wrapper.__wrapped__ = callback
        self._push_exit_callback(_exit_wrapper)
        return callback
552055
def run_callback(self):
        

        if self._callback_func is not None:
            try:
                self._callback_func(self._request, self._result)
            except Exception:  # pylint: disable=broad-except
                LOGGER.exception('An unhandled error occurred while running '
                                 'future callback')
1113581
def add_callback(self, callback=None, errorback=None):
        
        self._callback = callback
        self._errorback = errorback
1249103
def register_callback(self, callback):
        
        if not callable(callback):
            raise ValueError('callback is not a callable')

        self.callbacks.append(callback)
467564
def update(callback=None, path=None, method=Method.PUT, resource=None, tags=None, summary="Update specified resource.",
           middleware=None):
    # type: (Callable, Path, Methods, Resource, Tags, str, List[Any]) -> Operation
    
    def inner(c):
        op = ResourceOperation(c, path or PathParam('{key_field}'), method, resource, tags, summary, middleware)
        op.responses.add(Response(HTTPStatus.NO_CONTENT, "{name} has been updated."))
        op.responses.add(Response(HTTPStatus.BAD_REQUEST, "Validation failed.", Error))
        op.responses.add(Response(HTTPStatus.NOT_FOUND, "Not found", Error))
        return op
    return inner(callback) if callback else inner
1134841
def _copy_with_changed_callback(self, new_callback):
        '''  '''
        return PeriodicCallback(self._document, new_callback, self._period, self._id)
133273
def response(self, callback=None):
        
        if not callback:
            callback = type(self).AdvancedJsonify
        resp = {
            "status": "error",
            "message": self.message
        }
        if self.step:
            resp["step"] = self.step

        self.LOGGER.error(self.message, extra={"step": self.step, "context": self.context})
        return callback(resp, status_code=self.code)
697012
def add_callback(self, callback: callable):
        
        def internal_callback(*args):
            try:
                callback()
            except TypeError:
                callback(self.get())

        self._var.trace('w', internal_callback)
718739
function(params, callback) {
        /**
         * Callback for QB.chat.message.list()
         * @param {Object} error - The error object
         * @param {Object} messages - The messages object.
         * @callback listMessageCallback
         * */

        this.service.ajax({
            url: Utils.getUrl(MESSAGES_API_URL),
            data: params
        }, callback);
    }