Class AdmissionGateBlock<T>
- Namespace
- CounterpointCollective.Dataflow
- Assembly
- Dataflow.Composable.dll
A dataflow block that conditionally admits messages into an inner target block based on user-defined AdmissionGateHooks.
Use this block when you want to control when/which messages are allowed to enter the block dynamically, e.g. by throttling rules.
Features include:
- Hooks to decide whether a message may enter, when it enters, and if entry fails.
- Automatic postponement of messages that are not currently allowed to enter.
- Processing of postponed messages when state changes allow them to be admitted.
public class AdmissionGateBlock<T> : AbstractEncapsulatedTargetBlock<T>, ITargetBlock<T>, IDataflowBlock
Type Parameters
T
- Inheritance
-
AbstractEncapsulatedDataflowBlockAbstractEncapsulatedTargetBlock<T>AdmissionGateBlock<T>
- Implements
-
ITargetBlock<T>
- Inherited Members
- Extension Methods
Constructors
AdmissionGateBlock(ITargetBlock<T>, AdmissionGateHooks)
public AdmissionGateBlock(ITargetBlock<T> buffer, AdmissionGateHooks h)
Parameters
bufferITargetBlock<T>hAdmissionGateHooks
Properties
InputCompletion
Whether a completion request has been made and there are no more buffered messages waiting to enter.
public Task InputCompletion { get; }
Property Value
IsCompletionRequested
Whether a completion request has been made.
public bool IsCompletionRequested { get; }
Property Value
Methods
ConfigureHooks(AdmissionGateHooks)
public void ConfigureHooks(AdmissionGateHooks h)
Parameters
ProcessPostponedMessages()
Processes any messages that have been postponed and are now eligible for handling.
You typically may want to call this method after changing the state that is checked in the MayTryToEnter hook transitioned to allow messages to enter.
public void ProcessPostponedMessages()