-
Notifications
You must be signed in to change notification settings - Fork 34
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
Allow to enrich a command as well as an event #74
Comments
Good idea. I think it is doable using a trick similar to You can create |
That's another possible interpretation. Basically I prefer MTL style typeclass with effect-native interpretation over traditional monad transformer, for example, Speaking of the Akka cluster runtime, the tricky part seems to me is steps 2 and 3 in the above use case. Regardless of the effect stack, the wire protocol should encode the command and metadata something like
@typeclass trait InvariantK[A[_[_]]] {
def imapK[F[_], G[_]](af: A[F])(fk: F ~> G)(gK: G ~> F): A[G]
} |
I see what you want however I prefer to use composition rather than modify existing runtime. So I need some time to think about it :) |
I understand that you want to avoid changes in the runtime because you're already running Aecor based services in production. Please feel free to take your time and let me know your thoughts :) I'll add my findings as well. |
It would be nice if I could attach some metadata such as the correlation id to a command so that it can be merged into the metadata of the corresponding events.
There are already pure equivalents of Java's
ThreadLocal
such asmonix.eval.TaskLocal
andzio.FiberRef
that can propagate its local state through the effect context.A possible use case:
TaskLocal
/FiberRef
Reference: https://blog.softwaremill.com/correlation-ids-in-scala-using-monix-3aa11783db81
The text was updated successfully, but these errors were encountered: