Documentation
Table of Contents

Class KeepPreviousPolicy

Namespace
IntentSharp.Specialist
Assembly
IntentSharp.Specialist.dll

Decides whether calls keep running on the specialist in use while a changed request is requested, waited for and judged in the background. Set it in KeepPrevious or an intent's KeepPrevious. The default is Never: callers wait for the new specialist.

public sealed class KeepPreviousPolicy
Inheritance
object
KeepPreviousPolicy
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Extension Methods

Remarks

When the policy allows, a call that finds the request changed starts the new request in the background and returns at once on the specialist in use, and so do the calls after it. The new specialist replaces the previous one only when it fits. An offer that does not fit, a wait that runs out, or any other failure of the background request leaves the previous specialist serving, and Pending shows where the change stands. With no specialist in use, there is nothing to keep, and the call waits as it does under Never.

Properties

Always

Always keeps the previous specialist serving while a changed request is handled in the background.

Description

"never", "always" or "when", for logs and messages.

Never

Never keeps the previous specialist: a changed request makes callers wait for the new one. The default.

Methods

When(Func<KeepPreviousContext, bool>)

Keeps the previous specialist serving when predicate returns true for the change, for example only when the new definition belongs to the same family as the previous one. It is called on the caller's thread, once for each change a call finds, before anything is requested. An exception it throws reaches the caller.