//defer is called during the execution of an IAction void IEngineScope <TModel> .Defer(IDeferredAction <TModel> action, bool onlyIfValidationsResolved) { string key = RunManager.GetDeferralId(); if (onlyIfValidationsResolved) { this.finalize.Add(key, action); } else { this.finalizeAlways.Add(key, action); } }
/// <summary> /// Sets up and sends a deferred action to the server. /// </summary> /// <param name="action"></param> /// <returns></returns> public virtual ICommandResult Action(IDeferredAction action) { ICommandResult result = null; if (action.GetAction() != null) { // Wait for responses from this action this.DeferredActions.TryAdd(action.GetAction().Uid, action); // Send the action for processing result = this.Action(action.GetAction()); // Alert the deferred action of packets that have been sent action.TryInsertSent(action.GetAction(), result.Now.Packets); } // Now return the result return result; }
public DeferProxy(IDeferredAction <TSubModel> deferAction, IEngineScopeDefer <TSubModel> scope) { this.deferAction = deferAction; this.deferScope = scope; }
private static void AddDeferredAction(IDeferredAction action) { DeferredActions.Add(action); }