public void Start() { EnsureNotStopping(); Jhu.Graywulf.Logging.Logger.Instance.Writers.Add(new Jhu.Graywulf.Logging.StreamLogWriter(Console.Out)); graywulfLogger = new Jhu.Graywulf.Activities.GraywulfTrackingParticipant(); }
public void Stop(TimeSpan timeout) { lock (syncRoot) { if (stopRequested) { throw new InvalidOperationException(); } stopRequested = true; } // Wait until all workflows complete while (true) { lock (syncRoot) { if (workflows.Count == 0) { break; } } Thread.Sleep(100); // TODO: use constant } graywulfLogger = null; stopRequested = false; }
private void InitializeMembers() { this.syncRoot = new object(); this.stopRequested = false; this.workflows = new Dictionary<Guid, WorkflowDetails>(); this.graywulfLogger = null; }