In akka typed, we have concept of Behavior.
If we want to retain same behaviour by an actor we return Behaviors.same when we are done processing a message. But then we can also return this. How are two different?
They work the same. When using the FP:y-style of defining actors you will not have a this to return so you can only use Behaviors.same.
When defining actors in OO style (extending AbstractBehavior) you can use both, but we have tried to consistently use this in such samples in the docs and that's the recommendation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With