Helper library to allocate and retrieve singleton actors in Dask
Project description
dask-actor-singleton
This package works around common transient errors and pitfalls in creating a singleton instance of an Actor in Dask. It provides a clean interface for retrieving the singleton instance, and allocating it when necessary.
Usage
import dask_actor_singleton
class MyActor:
def __init__(self, arg):
self.value = arg
def inc(self):
self.value += 1
return self.value
client = dask.distributed.Client()
actor = dask_actor_singleton.get('my_actor', create=lambda: MyActor(8))
print(actor.inc().result()) # 9
# Now, on a different computer / dask.distributed.Client, run this script again:
# ...
print(actor.inc().result()) # 10
History
- 2021-07-19 v1.0 release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for dask-actor-singleton-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c4e469ac8f3665db2f23d7696c57c0d92129d877e6534c10e36ab25925d9638 |
|
MD5 | 9bae44414306ccfb47c6cb3c4b393875 |
|
BLAKE2b-256 | a2c81deb20305908db1a354d8f837256e22d9673b3d0ebc2ce916682e88890c7 |