Merges model's callbacks and "plugged" callbacks.
If under production environment, the callbacks will be cached.
511768
protected function allCallbacks()
    {
        if (Rails::env() == 'production') {
            return Rails::cache()->fetch('rails.models.' . get_called_class() . '.callbacks', function() {
                return array_merge_recursive(
                    $this->callbacks(),
                    $this->pluggedCallbacks()
                );
            });
        } else {
            return array_merge_recursive(
                $this->callbacks(),
                $this->pluggedCallbacks()
            );
        }
    }
808353
function(result, cached, callback) {
            self.metacache.store(id, processor, cached, function(err) {
                if (err) return callback(err);
                callback(null, result);
            });
        }
65136
def add_callback(obj, callback, args=()):
    """"""
    callbacks = obj._callbacks
    node = Node(callback, args)
    # Store a single callback directly in _callbacks
    if callbacks is None:
        obj._callbacks = node
        return node
    # Otherwise use a dllist.
    if not isinstance(callbacks, dllist):
        obj._callbacks = dllist()
        obj._callbacks.insert(callbacks)
        callbacks = obj._callbacks
    callbacks.insert(node)
    return node
136546
def update_models(ctx, f=False):
    
    if f:
        manage(ctx, 'create_models_from_sql --force True', env={})
    else:
        manage(ctx, 'create_models_from_sql', env={})
460931
function (model, options, callback) {

                var self = this;

                flow()
                    .seq(function (cb) {
                        self._beforeModelSave(model, options, cb);
                    })
                    .seq("result", function (cb) {
                        self._saveModel(model, options, cb);
                    })
                    .seq(function (cb) {
                        self._afterModelSave(this.vars.result || model, options, cb);
                    })
                    .exec(function (err, results) {
                        callback && callback(err, results.result || model, options);
                    });
            }
874563
def add_callbacks(self, future, callback, errback):
        
        def done(f):
            try:
                res = f.result()
                if callback:
                    callback(res)
            except Exception:
                if errback:
                    errback(create_failure())
        return future.add_done_callback(done)
986651
def add_done_callback(self, fn):
        
        if self.done():
            return fn(self)
        self._callbacks.append(fn)
499682
def _merge_includes(self):
        
        raw_include_path = self.get_global_include()
        if raw_include_path:
            abs_include_path = self._get_global_include_abs_path(
                raw_include_path
            )
            self._validate_global_include(abs_include_path)
            self.set_global_include(abs_include_path)

            for infile in glob.glob(abs_include_path):
                self.config.merge(
                    self._configobj_factory(infile=infile)
                )
981309
@RequestMapping(value = "/api/plugins/reload", method = RequestMethod.GET)
    public
    @ResponseBody
    HashMap<String, Object> reloadPlugins(Model model) {
        try {
            PluginManager.destroy();
        } catch (Exception e) {
        }

        return pluginInformation();
    }
197130
function mergeListeners(emitter) {
      var events = emitter._events;
      _.each(events, function (fns, type) {
        if (Array.isArray(fns)) {
          _.each(fns, function (fn) {
            if (_.isFunction(fn)) {
              self.on(type, fn);
            }
          });
        } else if (_.isFunction(fns)) {
          self.on(type, fns);
        }
      });
    }
1204628
def register_callback_reassigned(self, func, serialised=True):
        
        self.__add_callback(_CB_REASSIGNED, func, serialised_if_crud=serialised)
484556
private function pluggedCallbacks()
    {
        $callbacks = [];
        
        foreach (self::getReflection()->getMethods() as $method) {
            $methodName = $method->getName();
            if (
                strpos($methodName, 'Callbacks') === strlen($methodName) - 9
                && strpos($method->getDeclaringClass()->getName(), 'Rails') !== 0
            ) {
                $callbacks = array_merge($callbacks, $this->$methodName());
            }
        }
        
        return $callbacks;
    }
276325
function (uses, payload, message, callback) {
        var middles = getMiddlewares(uses, payload, message);
        internal.executer(middles).series(function (result) {
            return callback(internal.merge.apply(this, [payload].concat(result)));
        });
    }
162262
def register_callback_renamed(self, func, serialised=True):
        
        self.__add_callback(_CB_RENAMED, func, serialised_if_crud=serialised)
443704
def register_callbacks(self, on_create, on_modify, on_delete):
        
        self.on_create = on_create
        self.on_modify = on_modify
        self.on_delete = on_delete
501216
def reload!
      clear

      @mixins.each do |file|
        mixin(file)
      end

      @callbacks.each do |callback|
        callback.call(self)
      end
    end
647664
function (data, isMerge) {
        if (isMerge === true) {
            deepMerge(conf, data);
        } else {
            conf = JSON.parse(JSON.stringify(data || {}))
        }
    }