akka-typed-session
akka-typed-session copied to clipboard
vetExternalProtocol should be a macro
trafficstars
- to avoid calling the actual method that creates the Operation
- to generate readable error output in case of a mismatch
Hi Roland
Can we use scala.meta for this ?
How would the macro be used, do we use annotation ?
For example -
@VetExternalProtocol(ProcessBased.getMoney)
object GetMoneyProtocol extends E.Protocol {
...
}
Cheers :)
I imagine the protocol definition to come from an external source, so the macro should not act on that one. Let’s start by just turning the vetExternalProtocol method into a def-macro. Then we can see whether we make it an annotation to be applied to the process definition (i.e. the getMoney method).