cefn / watchable

Repo for @watchable/store and supporting packages.
MIT License
5 stars 1 forks source link

Add an API signature allowing strategy reuse #77

Open cefn opened 3 months ago

cefn commented 3 months ago

Currently nevermore strategy options are specified directly in the calls to createExecutorStrategy or createSettlementSequence.

This mean that a new strategy is always created by those calls, so it's impossible to share a strategy between both the executor API and the settlement API, or multiple instances of each.

Under the hood both implementations call createStrategyFromOptions.

It should therefore be trivial to lift the common creation logic, and expose a further method call that allows reuse of the same strategy. This might include e.g. executors that share only the last part of a strategy pipeline, and specialise the earlier strategies.