public Task EvaluateAsync(MemberEvaluator e, CancellationToken cancellationToken = default) { // Remove walker before processing as to prevent reentrancy. // NOTE: first add then remove so we don't get moment when // walker is missing from either set. _processed.Add(e.Target); _evaluators.TryRemove(e.Target, out _); return(e.EvaluateAsync(cancellationToken)); }
public void Evaluate(MemberEvaluator e) { // Remove walker before processing as to prevent reentrancy. // NOTE: first add then remove so we don't get moment when // walker is missing from either set. _processed.Add(e.Target); _evaluators.TryRemove(e.Target, out _); e.Evaluate(); }
public void Add(MemberEvaluator e) => _evaluators[e.Target] = e;