Bourse.OptionSaga.Executor (bourse v0.1.0)

Copy Markdown View Source

Executes one saga command against caller-supplied exchange configurations.

It performs exactly one submission or cancellation. Reconciliation may read the order endpoint and provider order-state collections, but never submits an order. Retry policy belongs to Bourse.OptionSaga, where ambiguous writes are journaled before another command can be emitted.

Summary

Functions

Executes one command using the exchange matching its venue/account domain.

Types

exchanges()

@type exchanges() ::
  %{required({String.t(), term()}) => Bourse.Exchange.t()}
  | %{required(String.t()) => Bourse.Exchange.t()}

outcome()

@type outcome() ::
  {:ok, Bourse.Order.t()}
  | {:not_found, map()}
  | {:unknown, term()}
  | {:error, Bourse.Error.t()}

Functions

execute(command, exchanges, opts \\ [])

@spec execute(map(), exchanges(), keyword()) :: outcome()

Executes one command using the exchange matching its venue/account domain.