-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a Cats extension module #61
Comments
Hi Renato, given that Cats is deprecating Xor in favour of the new Either in scala 2.12 (right biased) do you see still see a value to provide support for Xor? |
Good point. Scala 2.12 is almost there so we could put support for Xor on hold and have it only for the new biased Either. And of course, support for Validated |
I have done some progress on this (only analysis and some basic design) and some ideas and issues cames to the surface. The main problem I'm facing right now is that whatever effect we choose on the behavior side, it always get transformed to the effect of the backend we use. For instance, we have three effects that we can use when defining command handlers: A command handler using That means the the effects on the behavior definition are not necessarily preserved once executed by the backend. I found a good solution to extend We will end-up with something like: Validated[NonEmptyList[String],Events]
class InvalidException(errors: NonEmptyList[String])
// assuming AkkaBackend
val result = aggregateRef ? cmd
// in case of failures, result completes with
// Failure(InvalidException) Which is awkward. The only way of having a |
It's now possible to build an extensions (ie: new InvokerDirectives) for Cats (see #63). However, I'm considering making Cats a full citizen in Fun.CQRS. I'm using it in an internal project right now, especially It's especially handy for fine-grained events. Whenever we have a |
The goal is to have an extension module that we can use Validated or Xor as return time for command handlers.
Things that need to be added
The text was updated successfully, but these errors were encountered: