Beispiel #1
0
 public Job()
 {
     this.JobID       = Guid.NewGuid().ToString();
     this.JobPriority = JobPriority.Normal;
     this.IsActived   = true;
     _jobStatus       = new JobStatusImpl();
 }
 public JobStatusEventArgs(IJobStatus jobStatus)
 {
     if (jobStatus == null)
     {
         throw new ArgumentNullException("jobStatus");
     }
     this.jobStatus = jobStatus;
 }
 public JobStatusEventArgs(IJobStatus jobStatus)
 {
     if (jobStatus == null)
     {
         throw new ArgumentNullException("jobStatus");
     }
     this.jobStatus = jobStatus;
 }
        public Task ListenStatusAsync(IJobStatus jobStatus)
        {
            Task rv = null;

            if (messageWriter == null)
            {
                throw new InvalidOperationException("messageWriter can not be null when job status observed.");
            }

            if (jobStatus == null)
            {
                log.Warn("Unexpected null job status!");
            }
            else
            {
                StreamResponse response = ToStreamResponse(jobStatus);
                rv = messageWriter.WriteAsync(response);
            }

            return rv;
        }
        public Task ListenStatusAsync(IJobStatus jobStatus)
        {
            Task rv = null;

            if (messageWriter == null)
            {
                throw new InvalidOperationException("messageWriter can not be null when job status observed.");
            }

            if (jobStatus == null)
            {
                log.Warn("Unexpected null job status!");
            }
            else
            {
                StreamResponse response = ToStreamResponse(jobStatus);
                rv = messageWriter.WriteAsync(response);
            }

            return(rv);
        }
Beispiel #6
0
 public void RegisterHostedJobInstance(IJobStatus job)
 {
     _jobs.Add(job);
 }
 private static StreamResponse ToStreamResponse(IJobStatus status)
 {
     return StreamResponse.Create(status.ExitStatus, status.DataSource.ToString(), status.Data);
 }
 private static StreamResponse ToStreamResponse(IJobStatus status)
 {
     return(StreamResponse.Create(status.ExitStatus, status.DataSource.ToString(), status.Data));
 }
Beispiel #9
0
            private static BuildInputHandler HandleArtifactInput(ArtifactBuildInput artifact, IJobStatus jobStatus) => async cancellationToken => {
                if (!PathUtil.IsValidSubPath(artifact.ArtifactPath))
                {
                    throw new Exception("Invalid artifact path");
                }

                await jobStatus.WaitForComplete(cancellationToken);

                return(Path.Combine(jobStatus.ArtifactDir, artifact.ArtifactPath));
            };