Class HeldSpecialistPolicy
- Namespace
- IntentSharp.Specialist
- Assembly
- IntentSharp.Specialist.dll
Decides whether an ensure puts a fitting held specialist (HeldSpecialist) in use from the store before it requests or waits. Set it in UseHeld or an intent's UseHeld. The default is Use.
public sealed class HeldSpecialistPolicy
- Inheritance
-
objectHeldSpecialistPolicy
- Inherited Members
-
object.Equals(object)object.Equals(object, object)object.GetHashCode()object.GetType()object.ReferenceEquals(object, object)object.ToString()
- Extension Methods
Remarks
A held record is considered only when it was held for the intent and the request hash being ensured, its verdict was a fit, and the runtime has no offer for that request already. When the policy allows it, a record whose offer named a configured provider is put in use with no call to the service and no wait; a record whose offer brought a provider of its own is recalled through RecallAsync(HeldSpecialist, CancellationToken), and when the service cannot recall it the runtime waits on the recorded ticket as it would without the record.
Properties
- Description
"use", "never" or "when", for logs and messages.
- Never
Never uses held records: an ensure requests or waits as it does without them.
- Use
Puts a fitting held specialist in use. The default.
Methods
- When(Func<HeldSpecialistContext, bool>)
Puts a fitting held specialist in use when
predicatereturns true for it, for example only when it was held less than a day ago. It is called once for each fitting record an ensure finds, before anything is requested. An exception it throws reaches the caller.