//
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
namespace MUnique.OpenMU.GameLogic;
using System.Threading;
///
/// Interface for an object pool which provides an async get method which allows
/// to postpone the get until the next object is available.
///
/// The type which should be pooled.
public interface IObjectPool : IDisposable
where T : class
{
///
/// Gets an object from the pool if one is available, otherwise creates one
/// or waits until one is available.
///
/// The cancellation token.
/// A .
ValueTask GetAsync(CancellationToken cancellationToken = default);
///
/// Return an object to the pool.
///
/// The object to add to the pool.
void Return(T obj);
}