示例#1
0
文件: Jobs.cs 项目: AARNet/Rocket
        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;
        }
示例#2
0
        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);
                }
            }
        }
示例#3
0
文件: Jobs.cs 项目: AARNet/Rocket
 private void Jobs_OnJobDone(object source, JobEventArgs e, int id)
 {
     OnJobDone?.Invoke(this, new JobsEventArgs(e));
 }