This interface allows to have the queue as a data source for some stream.
public interface ISourceQueue<in T>
Methods| Improve this Doc View Source
Method offers next element to a stream and returns task that:
- competes with QueueOfferResult.Enqueued if element is consumed by a stream
- competes with QueueOfferResult.Dropped when stream dropped offered element
- competes with QueueOfferResult.QueueClosed when stream is completed while task is active
- competes with QueueOfferResult.Failure when failure to enqueue element from upstream
- fails if stream is completed or you cannot call offer in this moment because of implementation rules (like for backpressure mode and full buffer you need to wait for last offer call task completion.
Task<IQueueOfferResult> OfferAsync(T element)
element to send to a stream
Method returns Task that will be completed if the stream completes, or will be failed when the stage faces an internal failure.