Table of Contents

Class HookStage<TEvent, TCurrent, TContext>

Namespace
DotBoxD.Plugins.Runtime.Hooks
Assembly
DotBoxD.Plugins.dll

A re-typed stage in a hook chain after a HookPipeline<TEvent>.Select. It carries a composed projection of the original event to the element currently flowing (TCurrent) plus a short-circuit flag, so Where/Select compose without re-keying the pipeline (it stays keyed by TEvent). Terminals re-run the projection per publish and short-circuit when a Where rejected the element. Every fluent method offers both the (element, context) and element-only lambda arities, chosen independently per stage.

public class HookStage<TEvent, TCurrent, TContext>

Type Parameters

TEvent
TCurrent
TContext
Inheritance
HookStage<TEvent, TCurrent, TContext>
Inherited Members

Methods

Run(Action<TCurrent, TContext>)

public HookPipeline<TEvent, TContext> Run(Action<TCurrent, TContext> handler)

Parameters

handler Action<TCurrent, TContext>

Returns

HookPipeline<TEvent, TContext>

Run(Action<TCurrent>)

public HookPipeline<TEvent, TContext> Run(Action<TCurrent> handler)

Parameters

handler Action<TCurrent>

Returns

HookPipeline<TEvent, TContext>

Run(Func<TCurrent, ValueTask>)

public HookPipeline<TEvent, TContext> Run(Func<TCurrent, ValueTask> handler)

Parameters

handler Func<TCurrent, ValueTask>

Returns

HookPipeline<TEvent, TContext>

Run(Func<TCurrent, TContext, ValueTask>)

The terminal the analyzer lowers to verified IR; un-lowered it throws (never native).

public HookPipeline<TEvent, TContext> Run(Func<TCurrent, TContext, ValueTask> handler)

Parameters

handler Func<TCurrent, TContext, ValueTask>

Returns

HookPipeline<TEvent, TContext>

RunLocal(Action<TCurrent, TContext>)

public HookPipeline<TEvent, TContext> RunLocal(Action<TCurrent, TContext> handler)

Parameters

handler Action<TCurrent, TContext>

Returns

HookPipeline<TEvent, TContext>

RunLocal(Action<TCurrent>)

public HookPipeline<TEvent, TContext> RunLocal(Action<TCurrent> handler)

Parameters

handler Action<TCurrent>

Returns

HookPipeline<TEvent, TContext>

RunLocal(Func<TCurrent, ValueTask>)

public HookPipeline<TEvent, TContext> RunLocal(Func<TCurrent, ValueTask> handler)

Parameters

handler Func<TCurrent, ValueTask>

Returns

HookPipeline<TEvent, TContext>

RunLocal(Func<TCurrent, TContext, ValueTask>)

Native host terminal over the projected element (NOT sandboxed).

public HookPipeline<TEvent, TContext> RunLocal(Func<TCurrent, TContext, ValueTask> handler)

Parameters

handler Func<TCurrent, TContext, ValueTask>

Returns

HookPipeline<TEvent, TContext>

Select<TNext>(Func<TCurrent, TContext, TNext>)

public HookStage<TEvent, TNext, TContext> Select<TNext>(Func<TCurrent, TContext, TNext> projection)

Parameters

projection Func<TCurrent, TContext, TNext>

Returns

HookStage<TEvent, TNext, TContext>

Type Parameters

TNext

Select<TNext>(Func<TCurrent, TNext>)

public HookStage<TEvent, TNext, TContext> Select<TNext>(Func<TCurrent, TNext> projection)

Parameters

projection Func<TCurrent, TNext>

Returns

HookStage<TEvent, TNext, TContext>

Type Parameters

TNext

UseGeneratedChain(PluginPackage)

public HookPipeline<TEvent, TContext> UseGeneratedChain(PluginPackage package)

Parameters

package PluginPackage

Returns

HookPipeline<TEvent, TContext>

Where(Func<TCurrent, bool>)

Element-only filter over the projected element — the (element, context) overload with the context discarded, so a stage need not take the context it doesn't use.

public HookStage<TEvent, TCurrent, TContext> Where(Func<TCurrent, bool> filter)

Parameters

filter Func<TCurrent, bool>

Returns

HookStage<TEvent, TCurrent, TContext>

Where(Func<TCurrent, TContext, bool>)

public HookStage<TEvent, TCurrent, TContext> Where(Func<TCurrent, TContext, bool> filter)

Parameters

filter Func<TCurrent, TContext, bool>

Returns

HookStage<TEvent, TCurrent, TContext>