Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
JobExecutionStatus.cs
1using System;
2using System.Threading;
3using System.Threading.Tasks;
6using Waher.Script;
8
9namespace Waher.Jobs
10{
14 public class JobExecutionStatus : IDisposable
15 {
16 private readonly DateTime startTime = DateTime.UtcNow;
17 private readonly Variables variables = new Variables();
18 private readonly Query query;
19 private readonly Language language;
20 private readonly JobReportDetail reportDetail;
21 private readonly SemaphoreSlim semaphore = new SemaphoreSlim(1);
22
32 {
33 this.Job = Job;
34 this.query = Query;
35 this.language = Language;
36 this.reportDetail = ReportDetail;
37 }
38
42 public Job Job { get; }
43
47 public Query Query => this.query;
48
52 public Language Language => this.language;
53
57 public JobReportDetail ReportDetail => this.reportDetail;
58
62 public DateTime StartTime => this.startTime;
63
67 public Variables Variables => this.variables;
68
72 public void Dispose()
73 {
74 this.semaphore.Dispose();
75 }
76
80 public async Task Lock()
81 {
82 await this.semaphore.WaitAsync();
83 }
84
88 public void Unlock()
89 {
90 this.semaphore.Release();
91 }
92 }
93}
Contains information about the execution of a job.
void Dispose()
IDisposable.Dispose"/>
JobReportDetail ReportDetail
How much detail to include in the report.
DateTime StartTime
Start-time of job execution.
Query Query
Optional Query data receptor.
Variables Variables
Job execution state variables.
Language Language
Language to use.
async Task Lock()
Locks the job status object.
JobExecutionStatus(Job Job, Query Query, Language Language, JobReportDetail ReportDetail)
Contains information about the execution of a job.
void Unlock()
Unlocks the job status object.
Job Job
Job being executed.
Represents a job.
Definition: Job.cs:21
Contains information about a language.
Definition: Language.cs:17
Collection of variables.
Definition: Variables.cs:25
Class handling the reception of data from a query.
Definition: Query.cs:12
JobReportDetail
How much detail to include in job reports.