Table of Contents

Class ObserveOnlyExecutor<TState, TAction, TEvent>

Namespace
Virtufin.Base.Execution
Assembly
Virtufin.Base.dll

Decorator executor that wraps any other IExecutor<TState, TAction, TEvent> and records what would have happened without sending orders to the exchange. Used in SHADOW_* scenarios.

public sealed class ObserveOnlyExecutor<TState, TAction, TEvent> : IExecutor<TState, TAction, TEvent> where TState : IExecutionState where TAction : ITradeAction where TEvent : ITradeEvent<TAction, DateTimeOffset>

Type Parameters

TState
TAction
TEvent
Inheritance
ObserveOnlyExecutor<TState, TAction, TEvent>
Implements
IExecutor<TState, TAction, TEvent>
Inherited Members

Constructors

ObserveOnlyExecutor(IExecutor<TState, TAction, TEvent>)

Construct an observer wrapping inner.

public ObserveOnlyExecutor(IExecutor<TState, TAction, TEvent> inner)

Parameters

inner IExecutor<TState, TAction, TEvent>

Properties

Initial

The initial state of the executor.

public TState Initial { get; }

Property Value

TState

Observed

Read-only view of all observed events so far.

public IReadOnlyList<TEvent> Observed { get; }

Property Value

IReadOnlyList<TEvent>

Methods

ExecuteAsync(TState, TAction)

Execute one TAction, producing the next state and an outcome event.

public Task<(TState NextState, TEvent Event)> ExecuteAsync(TState state, TAction action)

Parameters

state TState

Current executor state.

action TAction

The action to execute.

Returns

Task<(TState NextState, TEvent Event)>

Tuple of (next state, outcome event).