Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
WorkItem.cs
1using System.Threading.Tasks;
2
4{
8 public abstract class WorkItem
9 {
10 private readonly TaskCompletionSource<bool> processed = new TaskCompletionSource<bool>();
11
15 public abstract Task Execute();
16
21 public void Processed(bool Result)
22 {
23 this.processed.TrySetResult(Result);
24 }
25
30 public Task<bool> Wait()
31 {
32 return this.processed.Task;
33 }
34 }
35}
Manages a Console operation.
Definition: WorkItem.cs:9
Task< bool > Wait()
Waits for the item to be processed.
Definition: WorkItem.cs:30
void Processed(bool Result)
Flags the item as processed.
Definition: WorkItem.cs:21
abstract Task Execute()
Executes the console operation.