Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConsoleFlush.cs
1using System.Threading.Tasks;
2
4{
8 public class ConsoleFlush : WorkItem
9 {
10 private readonly TaskCompletionSource<bool> result;
11 private readonly bool terminate;
12
18 public ConsoleFlush(bool Terminate, TaskCompletionSource<bool> Result)
19 {
20 this.terminate = Terminate;
21 this.result = Result;
22 }
23
27 public override async Task Execute()
28 {
29 await System.Console.Out.FlushAsync();
30
31 if (this.terminate)
32 ConsoleWorker.Terminate();
33
34 this.result.TrySetResult(true);
35 }
36 }
37}
Used to signal end of queue has been reached.
Definition: ConsoleFlush.cs:9
ConsoleFlush(bool Terminate, TaskCompletionSource< bool > Result)
Used to signal end of queue has been reached.
Definition: ConsoleFlush.cs:18
override async Task Execute()
Executes the console operation.
Definition: ConsoleFlush.cs:27
Processes console tasks, such as input and output, in a serialized asynchronous manner.
Manages a Console operation.
Definition: WorkItem.cs:9