public override void OnPush() { try { this._current = this.Grab(this._stage._in); if (this._current is IMultipleValues <T> mv) { this._currentEnumerator = mv.Values.GetEnumerator(); this.MoveCurrentEnumerator(); } this.PushPull(); } catch (Exception ex) { var directive = this._decider(ex); switch (directive) { case Directive.Stop: this.FailStage(ex); break; case Directive.Resume: if (!this.HasBeenPulled(this._stage._in)) { this.Pull(this._stage._in); } break; case Directive.Restart: this.RestartState(); if (!this.HasBeenPulled(this._stage._in)) { this.Pull(this._stage._in); } break; default: throw new ArgumentOutOfRangeException(); } } }
private void RestartState() { this._current = null; this._currentEnumerator = null; }