public async void Monitor() { while (IsRunning) { await Task.Delay(100); if (!IsRunning) { break; } var count = CandidateStore.GetCount(MatchSet.Id); if (count == MatchSet.Capacity) { Ready?.Invoke(MatchSet); } else if (count % 2 == 0) { Ready?.Invoke(MatchSet); } else { NotReady?.Invoke(MatchSet); } } }
public IEnumerable <IEnumerable <string> > ExecuteMatch() { if (CanExecute) { var processedData = Processor.Process(CandidateStore.Get(Set.Id)); return(Matcher.Match(processedData.Item1, processedData.Item2)); } else { throw new InvalidOperationException(); } }
public void Dispose() { CandidateStore.Dispose(); MatchSetStore.Dispose(); }
public void Collect(IEnumerable <ICandidate> candidates) { CandidateStore.Store(candidates); }