akka-typed-session icon indicating copy to clipboard operation
akka-typed-session copied to clipboard

vetExternalProtocol should be a macro

Open rkuhn opened this issue 8 years ago • 2 comments
trafficstars

  • to avoid calling the actual method that creates the Operation
  • to generate readable error output in case of a mismatch

rkuhn avatar May 14 '17 10:05 rkuhn

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 :)

simerplaha avatar May 15 '17 12:05 simerplaha

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).

rkuhn avatar May 15 '17 12:05 rkuhn