// MIT License - Copyright (c) 2026 wallstop
// Full license text: https://github.com/wallstop/unity-helpers/blob/main/LICENSE
namespace WallstopStudios.UnityHelpers.Utils
{
using System;
///
/// Specifies when automatic purge operations should be triggered on a pool.
/// This is a flags enum allowing multiple triggers to be combined.
///
///
/// Combine triggers using bitwise OR to enable multiple purge conditions:
///
/// PurgeTrigger triggers = PurgeTrigger.OnRent | PurgeTrigger.OnReturn;
///
///
[Flags]
public enum PurgeTrigger
{
///
/// Reserved for uninitialized state. Do not use directly.
///
[Obsolete("Use a specific PurgeTrigger value or combination of values.")]
None = 0,
///
/// Trigger purge checks when an item is rented from the pool.
/// Provides lazy cleanup during normal usage but adds overhead to every Get() call.
/// Consider for hot paths where per-operation cost matters.
///
OnRent = 1,
///
/// Trigger purge checks when an item is returned to the pool.
/// Useful for immediate cleanup when pool size limits are exceeded.
///
OnReturn = 2,
///
/// Purge only occurs when explicitly requested via the Purge method.
/// Use this for manual control over purge timing.
///
Explicit = 4,
///
/// Enable periodic purge checks based on a time interval.
/// This is the default behavior, providing time-based cleanup without per-operation overhead.
/// Requires setting PurgeIntervalSeconds in PoolOptions.
///
Periodic = 8,
}
}