C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
IProducerConsumerBuffer.cs
Go to the documentation of this file.
1using System;
2using System.Threading;
3
5{
8 public interface IProducerConsumerBuffer<out TProduced> : IDisposable
9 {
11 bool IsRunning { get; }
12
14 bool CanTake { get; }
15
19 void Start(CancellationToken? cancellationToken = null);
20
22 void Cancel();
23
29 TProduced TryTake(out bool success, CancellationToken? cancellation);
30 }
31}
Interface for a class that consumes from a source asynchronously and produces a queue of some other r...
TProduced TryTake(out bool success, CancellationToken? cancellation)
Attempts to remove an item from the produced list. May block if there is not yet an item ready,...
bool IsRunning
Indicates whether the producer is currently running.
bool CanTake
Indicates whether a call to Take will ever return another item.
void Start(CancellationToken? cancellationToken=null)
Start the asynchronous producer.
void Cancel()
Stop the producer from reading any more bytes.