// Copyright © WireMock.Net
using System.Diagnostics.CodeAnalysis;
namespace WireMock.Models;
///
/// A simple implementation for a Blocking Queue.
///
/// Specifies the type of elements in the queue.
public interface IBlockingQueue
{
///
/// Writes an item to the queue and signals that an item is available.
///
/// The item to be added to the queue.
void Write(T item);
///
/// Tries to read an item from the queue. Waits until an item is available or the timeout occurs.
///
/// The item read from the queue, or default if the timeout occurs.
/// True if an item was successfully read; otherwise, false.
bool TryRead([NotNullWhen(true)] out T? item);
///
/// Closes the queue and signals all waiting threads.
///
public void Close();
}