Registers a call back function
359939
def add_callback(self, func):
        
        if func is None: return
        func_list = to_list(func)

        if not hasattr(self, 'callback_list'):
            self.callback_list = func_list
        else:
            self.callback_list.extend(func_list)
291535
void registerCallback(AsynchConsumerCallback callback)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "registerCallback", callback);

    asynchConsumerCallback = callback;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "registerCallback");
  }
1138810
protected function registerBufferEmptyCallback()
    {
        $this->swoolePort->on('BufferEmpty', function ($server, $fd) {
            $this->dispatchEvent('BufferEmpty', $this->server, $this, $fd);
        });
    }
1338900
protected function registerResetDbAfterSuite()
    {
        $serviceCaller = new ServiceCaller($this->getTestConfig());
        $serviceCaller->setParameter('dumpDB', true);
        $serviceCaller->setParameter('dump-prefix', 'orig_db_dump');
        try {
            $serviceCaller->callService('ShopPreparation', 1);
        } catch (\Exception $e) {
            define('RESTORE_SHOP_AFTER_TEST_SUITE_ERROR', true);
        }

        register_shutdown_function(function () {
            if (!defined('RESTORE_SHOP_AFTER_TEST_SUITE_ERROR')) {
                $serviceCaller = new ServiceCaller();
                $serviceCaller->setParameter('restoreDB', true);
                $serviceCaller->setParameter('dump-prefix', 'orig_db_dump');
                $serviceCaller->callService('ShopPreparation', 1);
            }
        });
    }
1025727
def add_callback(self, name, func):
        

        if name not in self.callbacks:
            raise ValueError("Unknown callback name: %s" % name)

        self.callbacks[name].add(func)
1164338
def register(self, function):
        
        function = inspect.isclass(function) and function() or function
        name = function.name
        self[name] = function
268108
function AddCallback(mesgId, callbackFunction, callbackTimeout) {
    var callbackElement, now;

    now = new Date().getTime();

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

    callbackList.push(callbackElement);
}
1044611
def make_call_with_cb(self, fun, *args):
        """"""

        cid, event = self.handler.register_callback()
        argscp = list(args)
        argscp.append(cid)
        self.make_call(fun, *argscp)
        return event
762700
function callbackHandler(callback) {
        return function(error, data) {
            if (data === 'OK') {
                callback();
                return;
            }

            callback(error, deserializeResponse(data));
        };
    }
327529
def register_function(self, name: Optional[str]=None):
        
        def wrap(function: Callable)->Any:
            nonlocal name
            if name is None:
                name = function.__name__
            self.funcs[name] = function
            return function
        return wrap
935803
def register_helper(self, func):
        

        self._helper_names.add(func.__name__)
        return self.register(func)
1137305
protected function registerTaskCallback()
    {
        $this->swooleServer->on('Task', function ($server, $taskId, $srcWorkerId, $data) {
            $this->events->dispatch(new Events\TaskTriggered($this, $taskId, $srcWorkerId, $data));

            $this->dispatchEvent('Task', $this, $taskId, $srcWorkerId, $data);
        });
    }
69010
def add_callback(self, callback, *callback_args, **callback_kwargs):
        """"""
        return self.add_callbacks(callback, callback_args=callback_args,
                           callback_kwargs=callback_kwargs)
71479
function registerShutdownFunc($func, $args = array())
    {
        // if we are called statically, there is a potential
        // that no shutdown func is registered.  Bug #6445
        if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
            register_shutdown_function("_PEAR_call_destructors");
            $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
        }
        $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
    }
954126
def on(self, evt, func):
        ''''''
        if evt not in self._callbacks:
            raise NotImplementedError('callback "%s"' % evt)
        else:
            self._callbacks[evt] = func
786105
async def register_callback(self, cb):
        
        self._callbacks.add(cb)

        def unregister():
            self._callbacks.remove(cb)

        return unregister
1107346
function makeCallback(callback) {
  if (_.isFunction(callback)) {
    return callback;
  }
  var result = function() { return callback; };
  result._callback = callback;
  return result;
}