public virtual void AssetInvalidated(Dependency affectedDependencies, Guid asset_id) { base.ExecuteMethod("AssetInvalidated", delegate() { DependencyWorker <Asset> .EnqueueRequest(this.IFoundation, affectedDependencies, asset_id, this.ProcessAssetInvalidation); }); }
public virtual void GlobalSettingInvalidated(Dependency affectedDependencies, Guid global_setting_id) { base.ExecuteMethod("GlobalSettingInvalidated", delegate() { DependencyWorker <GlobalSetting> .EnqueueRequest(this.IFoundation, affectedDependencies, global_setting_id, this.ProcessGlobalSettingInvalidation); }); }
/// <summary> /// Abornal pattern, takes the first processMethod and uses that for all instances /// This means a potential memory leak, so ensure the caller has the same lifetime as this instance. /// [done so that dependencies can be visualized in one shared place] /// </summary> public static void EnqueueRequest(IFoundation foundation, Dependency dependencies, Guid entity_id, Action <Dependency, Guid> processMethod) { DependencyWorker <TEntity> worker = EnqueueRequest <DependencyWorker <TEntity> >(foundation, WORKER_NAME, new DependencyRequest() { Dependencies = dependencies, EntityID = entity_id }); if (worker != null) { if (worker.ProcessMethod == null) { worker.ProcessMethod = processMethod; worker.Execute(worker.IFoundation); // start it now (may have been waiting for processmethod) } } }