GitHub user bjmdev closed a discussion: Reducing boilerplate with annotations

I wonder whether boilerplate could be reduced by annotations which allow 
writing an actor in a short, but precise and clear way?

Maybe something like this:

```java
@Actor(Msg.class)
class SomeActor {

    @ActorContext
    private ActorContext<Msg> ctx;

    @HandleMessage(SomeMsg.class)
    public void onSomeMsg(final SomeMsg msg) {
        ctx.getLog().info("received some message: {}", msg);
    }

}
```

Of course, there is more to consider like switching behaviors (FSM), handling 
signals, etc... but it should be possible to come up with useful annotations to 
shorten the required LoC for (standard) actors.
People using Spring are used to annotation magic anyway :-)

What is the general opinion of this direction of thought from the maintainers?

Thanks and best regards!

GitHub link: https://github.com/apache/pekko/discussions/3350

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to