Pykka

Latest version: v4.0.2

Safety actively analyzes 638452 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 5

0.16

- Let actors access themselves through a proxy. See the `pykka.ActorProxy` documentation for use cases and usage examples. (Fixes: 9)

- Give proxies direct access to the actor instances for inspecting available attributes. This access is only used for reading and works since both threading and gevent based actors share memory with other actors. This reduces the creation cost for proxies, which is mostly visible in test suites that are starting and stopping lots of actors. For the Mopidy test suite, the run time was reduced by about 33%. This change also makes self-proxying possible.

- Fix bug where `pykka.Actor.stop()` called by an actor on itself did not process the remaining messages in the inbox before the actor stopped. The behavior now matches the documentation.

0.15

- Change the argument of `pykka.Future.set_exception()` from an exception instance to an `exc_info` three-tuple. Passing just an exception instance to the method still works, but it is deprecated and may be unsupported in a future release.

- Due to the above change `pykka.Future.get()` will now reraise exceptions with complete traceback from the point when the exception was first raised and not just a traceback from when it was reraised by `get()`. (Fixes: 10)

0.14

- Add `pykka.__version__` to conform with PEP 396. This deprecates `pykka.VERSION` and `pykka.get_version()`.

- Add `pykka.ActorRef.tell()` method in favor of now deprecated `pykka.ActorRef.send_one_way()`.

- Add `pykka.ActorRef.ask()` method in favor of now deprecated `pykka.ActorRef.send_request_reply()`.

- `pykka.ThreadingFuture.set()` no longer makes a copy of the object set on the future. The setter is urged to either only pass immutable objects through futures or copy the object himself before setting it on the future. This is a less safe default, but it removes unnecessary overhead in speed and memory usage for users of immutable data structures. For example, the Mopidy test suite of about 1000 tests, many of which are using Pykka, is still passing after this change, but the test suite runs approximately 20% faster.

0.13

- 10x speedup of traversable attribute access by reusing proxies.

- 1.1x speedup of callable attribute access by reusing proxies.

0.12.4

- Change and document order in which `pykka.ActorRegistry.stop_all()` stops actors. The new order is the reverse of the order the actors were started in. This should make `stop_all()` work for programs with simple dependency graphs in between the actors. For applications with more complex dependency graphs, the developer still needs to pay attention to the shutdown sequence. (Fixes: 8)

0.12.3

- If an actor that was stopped from `pykka.Actor.on_start()`, it would unregister properly, but start the receive loop and forever block on receiving incoming messages that would never arrive. This left the thread alive and isolated, ultimately blocking a clean shutdown of the program. The fix ensures that the receive loop is never executed if the actor is stopped before the receive loop is started.

- Set the thread name of any `pykka.ThreadingActor` to `PykkaActorThread-N` instead of the default `Thread-N`. This eases debugging by clearly labeling actor threads in e.g. the output of `threading.enumerate()`.

- Add utility method `pykka.ActorRegistry.broadcast()` which broadcasts a message to all registered actors or to a given class of registered actors. (Fixes: 7)

- Allow multiple calls to `pykka.ActorRegistry.unregister()` with the same `pykka.actor.ActorRef` as argument without throwing a `ValueError`. (Fixes: 5)

- Make the `pykka.ActorProxy`'s reference to its `pykka.ActorRef` public as `pykka.ActorProxy.actor_ref`. The `ActorRef` instance was already exposed as a public field by the actor itself using the same name, but making it public directly on the proxy makes it possible to do e.g. `proxy.actor_ref.is_alive()` without waiting for a potentially dead actor to return an `ActorRef` instance you can use. (Fixes: 3)

Page 4 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.