Table of Contents

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
AbstractEncapsulatedDataflowBlock
AbstractEncapsulatedTargetBlock<T>
AdmissionGateBlock<T>
Implements
Inherited Members
Extension Methods

Constructors

AdmissionGateBlock(ITargetBlock<T>, AdmissionGateHooks)

public AdmissionGateBlock(ITargetBlock<T> buffer, AdmissionGateHooks h)

Parameters

buffer ITargetBlock<T>
h AdmissionGateHooks

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

Task

IsCompletionRequested

Whether a completion request has been made.

public bool IsCompletionRequested { get; }

Property Value

bool

Methods

ConfigureHooks(AdmissionGateHooks)

public void ConfigureHooks(AdmissionGateHooks h)

Parameters

h AdmissionGateHooks

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()