Table of Contents

Class ProcessExtensions

Namespace
Virtufin.Core.Behaviour
Assembly
Virtufin.Core.dll

Drivers that fold an IProcess<TState, TInput, TOutput> coalgebra over a stream of inputs. The coalgebra itself stays pure and pull-based; these extensions add the reactive layer on demand — the scan combinator of the domain spec (§10.4).

public static class ProcessExtensions
Inheritance
ProcessExtensions
Inherited Members

Methods

Run<TState, TInput, TOutput>(IProcess<TState, TInput, TOutput>, IObservable<TInput>)

Run the process over a stream of inputs, starting from Initial. Emits the pair of evolved state and output for every input, in order.

public static IObservable<(TState State, TOutput Output)> Run<TState, TInput, TOutput>(this IProcess<TState, TInput, TOutput> process, IObservable<TInput> inputs)

Parameters

process IProcess<TState, TInput, TOutput>

The coalgebra to drive.

inputs IObservable<TInput>

Cold stream of input observations.

Returns

IObservable<(TState State, TOutput Output)>

Stream of (state, output) pairs, one per input.

Type Parameters

TState

The process's internal state.

TInput

The input observation.

TOutput

The output emitted at each step.

Run<TState, TInput, TOutput>(IProcess<TState, TInput, TOutput>, IObservable<TInput>, TState)

Run the process over a stream of inputs, starting from an explicit initial state (e.g. a checkpoint from a previous run). Emits the pair of evolved state and output for every input, in order. The state is fresh per subscription — resubscribing restarts from initialState.

public static IObservable<(TState State, TOutput Output)> Run<TState, TInput, TOutput>(this IProcess<TState, TInput, TOutput> process, IObservable<TInput> inputs, TState initialState)

Parameters

process IProcess<TState, TInput, TOutput>

The coalgebra to drive.

inputs IObservable<TInput>

Cold stream of input observations.

initialState TState

State to start folding from.

Returns

IObservable<(TState State, TOutput Output)>

Stream of (state, output) pairs, one per input.

Type Parameters

TState

The process's internal state.

TInput

The input observation.

TOutput

The output emitted at each step.