private void Process_Exited(object sender, EventArgs e) { this.stdout?.AppendLine(this.process.StandardOutput.ReadToEnd()); this.stderr?.AppendLine(this.process.StandardError.ReadToEnd()); int exitCode = this.process.ExitCode; this.process?.Close(); OnJobDone?.Invoke(this, new JobEventArgs(this.id, exitCode, getStdout(), getStderr())); //this.busy = false; }
protected override void DoJob() { var head = _queue.Peek(); if (head != null) { var diff = DateTime.Now.Subtract(head.Data.Data.InsertionDate).TotalMilliseconds; if (diff > ExpiretionThreshHoldInMilliseconds) { JobDoneArgs args = new JobDoneArgs(_queue.Dequeue()); OnJobDone?.Invoke(this, args); } } }
private void Jobs_OnJobDone(object source, JobEventArgs e, int id) { OnJobDone?.Invoke(this, new JobsEventArgs(e)); }