Hi Rick,
There are no current plans to implement a Behaviors analog, primarily because this hasn't been requested. If there is enough interest, this concept could be explored as a future addition to Thespian.
In Akka, the behavior essentially determines a state of the Actor that is used to guide the handling of the next message(s). This can currently be achieved in Thespian by directly expressing state:
class MyActor(Actor):
def __init__(self, *args, **kw):
super(MyActor, self).__init__(*args, **kw)
self.mystate = 0
def receive_Message(self, msg, sender):
if self.mystate == 0:
.... handling in state 0
elif self.mystate == 1:
.... handling in state 1
...
The equivalent to Akka's `Behaviors.stopped` is `self.send(self.myaddress, ActorExitRequest())`, and the Akka `Behaviors.setup` is handled by the `__init__()` method for the Actor.
If you see additional benefits to implementing Behaviors in Thespian (and especially if I've missed some aspects of their Akka implementation) please let me know: I'm not opposed to extending Thespian to support them but would like to make sure the additional feature benefit outweighs the additional complexity.
Regards,
Kevin