Skip to content

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.

[PipelineSurface(PipelineTransport.Local)]
public class HookStage<TEvent, TCurrent, TContext>

TEvent

TCurrent

TContext

objectHookStage<TEvent, TCurrent, TContext>

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Run(Func<TCurrent, TContext, ValueTask>, IRKernel?)

Section titled “ Run(Func<TCurrent, TContext, ValueTask>, IRKernel?)”

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

public HookPipeline<TEvent, TContext> Run(Func<TCurrent, TContext, ValueTask> handler, IRKernel? irHandler = null)

handler Func<TCurrent, TContext, ValueTask>

irHandler IRKernel?

HookPipeline<TEvent, TContext>

Run(Action<TCurrent, TContext>, IRKernel?)

Section titled “ Run(Action<TCurrent, TContext>, IRKernel?)”
public HookPipeline<TEvent, TContext> Run(Action<TCurrent, TContext> handler, IRKernel? irHandler = null)

handler Action<TCurrent, TContext>

irHandler IRKernel?

HookPipeline<TEvent, TContext>

Run(Func<TCurrent, ValueTask>, IRKernel?)

Section titled “ Run(Func<TCurrent, ValueTask>, IRKernel?)”
public HookPipeline<TEvent, TContext> Run(Func<TCurrent, ValueTask> handler, IRKernel? irHandler = null)

handler Func<TCurrent, ValueTask>

irHandler IRKernel?

HookPipeline<TEvent, TContext>

public HookPipeline<TEvent, TContext> Run(Action<TCurrent> handler, IRKernel? irHandler = null)

handler Action<TCurrent>

irHandler IRKernel?

HookPipeline<TEvent, TContext>

RunLocal(Func<TCurrent, TContext, ValueTask>)

Section titled “ RunLocal(Func<TCurrent, TContext, ValueTask>)”

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

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

handler Func<TCurrent, TContext, ValueTask>

HookPipeline<TEvent, TContext>

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

handler Action<TCurrent, TContext>

HookPipeline<TEvent, TContext>

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

handler Func<TCurrent, ValueTask>

HookPipeline<TEvent, TContext>

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

handler Action<TCurrent>

HookPipeline<TEvent, TContext>

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

Section titled “ Select<TNext>(Func<TCurrent, TContext, TNext>, IRFunc<TCurrent, TContext, TNext>?)”
public HookStage<TEvent, TNext, TContext> Select<TNext>(Func<TCurrent, TContext, TNext> projection, IRFunc<TCurrent, TContext, TNext>? irProjection = null)

projection Func<TCurrent, TContext, TNext>

irProjection IRFunc<TCurrent, TContext, TNext>?

HookStage<TEvent, TNext, TContext>

TNext

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

Section titled “ Select<TNext>(Func<TCurrent, TNext>, IRFunc<TCurrent, TNext>?)”
public HookStage<TEvent, TNext, TContext> Select<TNext>(Func<TCurrent, TNext> projection, IRFunc<TCurrent, TNext>? irProjection = null)

projection Func<TCurrent, TNext>

irProjection IRFunc<TCurrent, TNext>?

HookStage<TEvent, TNext, TContext>

TNext

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

package PluginPackage

HookPipeline<TEvent, TContext>

Where(Func<TCurrent, TContext, bool>, IRFunc<TCurrent, TContext, bool>?)

Section titled “ Where(Func<TCurrent, TContext, bool>, IRFunc<TCurrent, TContext, bool>?)”
public HookStage<TEvent, TCurrent, TContext> Where(Func<TCurrent, TContext, bool> filter, IRFunc<TCurrent, TContext, bool>? irFilter = null)

filter Func<TCurrent, TContext, bool>

irFilter IRFunc<TCurrent, TContext, bool>?

HookStage<TEvent, TCurrent, TContext>

Where(Func<TCurrent, bool>, IRFunc<TCurrent, bool>?)

Section titled “ Where(Func<TCurrent, bool>, IRFunc<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, IRFunc<TCurrent, bool>? irFilter = null)

filter Func<TCurrent, bool>

irFilter IRFunc<TCurrent, bool>?

HookStage<TEvent, TCurrent, TContext>