AlwaysGrantQuotaGate
NexusLabs.Needlr.AgentFramework¶
NexusLabs.Needlr.AgentFramework.Providers¶
AlwaysGrantQuotaGate Class¶
IQuotaGate that always grants reservations. Suitable for development and scenarios where quota tracking is not needed.
Inheritance System.Object 🡒 AlwaysGrantQuotaGate
Implements IQuotaGate
Methods¶
AlwaysGrantQuotaGate.ReleaseAsync(string, bool, CancellationToken) Method¶
Releases a previously granted reservation, reporting whether the attempt succeeded.
public System.Threading.Tasks.Task ReleaseAsync(string providerName, bool succeeded, System.Threading.CancellationToken cancellationToken);
Parameters¶
providerName System.String
The provider that was attempted.
succeeded System.Boolean
Whether the provider call succeeded.
cancellationToken System.Threading.CancellationToken
Cancellation token.
Implements ReleaseAsync(string, bool, CancellationToken)
Returns¶
AlwaysGrantQuotaGate.TryReserveAsync(string, CancellationToken) Method¶
Attempts to reserve quota for the given provider. Returns true if the reservation was granted, false if denied.
public System.Threading.Tasks.Task<bool> TryReserveAsync(string providerName, System.Threading.CancellationToken cancellationToken);
Parameters¶
providerName System.String
The provider requesting quota.
cancellationToken System.Threading.CancellationToken
Cancellation token.
Implements TryReserveAsync(string, CancellationToken)