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;
2using System.Threading.Tasks;
4
6{
10 public class ConsoleFlush : WorkItem
11 {
12 private readonly TaskCompletionSource<bool> result;
13 private readonly bool terminate;
14
20 public ConsoleFlush(bool Terminate, TaskCompletionSource<bool> Result)
21 {
22 this.terminate = Terminate;
23 this.result = Result;
24 }
25
30 public override async Task Execute(CancellationToken Cancel)
31 {
32 await System.Console.Out.FlushAsync();
33
34 if (this.terminate)
35 _ = Task.Run(async () => await ConsoleWorker.Terminate());
36
37 this.result.TrySetResult(true);
38 }
39 }
40}
Used to signal end of queue has been reached.
Definition: ConsoleFlush.cs:11
ConsoleFlush(bool Terminate, TaskCompletionSource< bool > Result)
Used to signal end of queue has been reached.
Definition: ConsoleFlush.cs:20
override async Task Execute(CancellationToken Cancel)
Executes the console operation.
Definition: ConsoleFlush.cs:30
Processes console tasks, such as input and output, in a serialized asynchronous manner.
Represents an asynchronous operation to be performed.
Definition: WorkItem.cs:10
Definition: ImplTypes.g.cs:58