Example app and service templates `dotnet new -i Equinox.Templates; dotnet new eqx*/pro*` https://github.com/jet/equinox https://github.com/jet/FsCodec
This pushes out a common helper method (resolve), and its shadowing outside of the type Service, but has the following properties:
ensures we keep intellisense for Stream working
keeps <Events.Event, Fold.State> DRY
keeps the type Service persistence agnostic
works well wrt needs to customize the maxAttempts for integration tests etc
Replaces the form:
type Service internal (log, resolve, maxAttempts) =
let resolve id =
let stream = resolve (streamName id)
Equinox.Stream<Events.Event, Fold.State>(log, stream, maxAttempts)
with
type Service internal (resolve : string -> Equinox.Stream<Events.Event,Fold.State>) =
and
let create resolve =
let resolver id =
let stream = resolve (streamName id)
Equinox.Stream(Serilog.Log.ForContext<Service>(), stream, maxAttempts = 3)
Service(resolver)
This is part of style cleanup in #53
This pushes out a common helper method (resolve), and its shadowing outside of the
type Service
, but has the following properties:<Events.Event, Fold.State>
DRYtype Service
persistence agnosticmaxAttempts
for integration tests etcReplaces the form:
with
and
@thednaz