Method TryTakeRecompileAsync
- Namespace
- IntentSharp.Mapping
- Assembly
- IntentSharp.dll
TryTakeRecompileAsync(string, string, int, TimeSpan, CancellationToken)
The persisted per-key cap on replacements, shared by every process on the store: takes one of
limit slots in the current window of length window, which starts at the first
slot taken after the previous window ended. Returns true when a slot was taken, false when the window's slots are
used up or limit is 0 or less.
Task<bool> TryTakeRecompileAsync(string @namespace, string key, int limit, TimeSpan window, CancellationToken cancellationToken = default)
Parameters
namespacestringThe namespace.
keystringThe mapping key.
limitintThe slots per window.
windowTimeSpanThe length of a window; greater than zero.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<bool>