Enforce that multiple calls to pykka.Future.set() raises an exception. This was already the case for some implementations. The exception raised is not specified.
Add filter(), join(), map(), and reduce() as convenience methods using the new set_get_hook() method.
Add support for running actors based on eventlet greenlets. See pykka.eventlet for details. Thanks to Jakub Stasiak for the implementation.
Update documentation to reflect that the reply_to field on the message is private to Pykka. Actors should reply to messages simply by returning the response from on_receive(). The internal field is renamed to pykka_reply_to a to avoid collisions with other message fields. It is also removed from the message before the message is passed to on_receive(). Thanks to Jakub Stasiak.
When messages are left in the actor inbox after the actor is stopped, those messages that are expecting a reply is now rejected by replying with an ActorDeadError exception. This causes other actors blocking on the returned Future without a timeout to raise the exception instead of waiting forever. Thanks to Jakub Stasiak.
This makes the behavior of messaging an actor around the time it is stopped more consistent:
Similarly, if you ask an actor to stop multiple times, and block on the responses, all the messages will now get an reply. Previously only the first message got a reply, potentially making the application wait forever on replies to the subsequent stop messages.
When ask() is used to asynchronously message a dead actor (e.g. block set to False), it will no longer immediately raise ActorDeadError. Instead, it will return a future and fail the future with the ActorDeadError exception. This makes the interface more consistent, as you’ll have one instead of two ways the call can raise exceptions under normal conditions. If ask() is called synchronously (e.g. block set to True), the behavior is unchanged.
A change to stop() reduces the likelyhood of a race condition when asking an actor to stop multiple times by not checking if the actor is dead before asking it to stop, but instead just go ahead and leave it to tell() to do the alive-or-dead check a single time, and as late as possible.
Change is_alive() to check the actor’s runnable flag instead of checking if the actor is registrered in the actor registry.
Backwards incompatible: Removed pykka.VERSION and pykka.get_version(), which have been deprecated since v0.14. Use pykka.__version__ instead.
Backwards incompatible: Removed pykka.ActorRef.send_one_way() and pykka.ActorRef.send_request_reply(), which have been deprecated since v0.14. Use pykka.ActorRef.tell() and pykka.ActorRef.ask() instead.
Backwards incompatible: Actors no longer subclass threading.Thread or gevent.Greenlet. Instead they have a thread or greenlet that executes the actor’s main loop.
This is backwards incompatible because you no longer have access to fields/methods of the thread/greenlet that runs the actor through fields/methods on the actor itself. This was never advertised in Pykka’s docs or examples, but the fields/methods have always been available.
As a positive side effect, this fixes an issue on Python 3.x, that was introduced in Pykka 0.16, where pykka.ThreadingActor would accidentally override the method threading.Thread._stop().
Backwards incompatible: Actors that override __init__() must call the method they override. If not, the actor will no longer be properly initialized. Valid ways to call the overridden __init__() method include:
super(MyActorSubclass, self).__init__()
# or
pykka.ThreadingActor.__init__()
# or
pykka.gevent.GeventActor.__init__()
Make pykka.Actor.__init__() accept any arguments and keyword arguments by default. This allows you to use super() in __init__() like this:
super(MyActorSubclass, self).__init__(1, 2, 3, foo='bar')
Without this fix, the above use of super() would cause an exception because the default implementation of __init__() in pykka.Actor would not accept the arguments.
Allow all public classes and functions to be imported directly from the pykka module. E.g. from pykka.actor import ThreadingActor can now be written as from pykka import ThreadingActor. The exception is pykka.gevent, which still needs to be imported from its own package due to its additional dependency on gevent.