I
that cata
needs is some how messed up
cata
can't do what i want
cata
does
-Ywarn-value-discard
is super helpful, especially when used along with -Xfatal-warnings
NotUsed
I think it is, for when you really intend to have no action
Saga[F[_], D]
- and that's because it should provide some create(data: D): F[Unit]
capability (every user's concrete saga implementation may operate on a different data type passed around)
EventsourcedBehavior
, but my question is whether you would consider that an acceptable design at all?
Saga[F[_], D]
shape that will have an existing EventsourcedSaga[F[_], D]
implementation, provided by the library out of the box, and the only thing that the user cares about is to specify the saga's flow (and wire everything, of course), with some DSL such as:step {
attempt { data =>
// we call some specific entity:
warehouses(...).markForDeparture(...)
}
.handleFailWith { data =>
warehouses(...).cancelDeparture(...)
}
.commitWith { data =>
warehouses(...).issueGoods(...)
}
// both handleFailWith and commitWith are optional
}
.step {
attempt { data =>
shops(...).reserveSpace(...)
}
// (...)
}
EventsourcedBehavior
, as Denis once suggested, but the whole interaction with it might feel a bit hacky, I would say...? And that's because EventsourcedBehavior
wasn't introduced with Saga[F[_], D]
shape in mind, obviously. I'm not entirely sure whether the final version done this way could end up being merged into the Aecor's master
, as it might not fit the rest of library's "zen". I haven't pushed the current POC to my fork, as it still requires major clean-up
T[F[_]]
algebras and EventsourcedBehavior
, so it seems that reusing existing blocks should be the way to go - possibly with some tweaks here and there. The alternative would carry much more work to be done. Anyhow, I would rather discuss saga's design premises before raising any PR
D
type parameter in question, that represents any data type that the particular saga operates on. It's data
type from the DSL snippet