2using System.Threading.Tasks;
12 private readonly Predicate<T> callback;
21 this.callback = Callback;
34 public bool Process(T Object) => this.callback(Object);
41 public Task<bool>
ProcessAsync(T Object) => Task.FromResult(this.callback(Object));
58 return Task.FromResult(
true);
Processor that uses a predicate callback to process objects.
Task< bool > ProcessAsync(T Object)
Processes an object asynchronously.
bool Process(T Object)
Processes an object synchronously.
PredicateProcessor(Predicate< T > Callback)
Processor that uses a predicate callback to process objects.
Task< bool > FlushAsync()
Called at the end of processing, to allow for flushing of buffers, etc.
bool Flush()
Called at the end of processing, to allow for flushing of buffers, etc.
bool IsAsynchronous
If the processor operates asynchronously.
Interface for processors of objects.