Metadata-Version: 2.1
Name: dask-actor-singleton
Version: 1.1.0
Summary: Helper library to allocate and retrieve singleton actors in Dask
Home-page: https://github.com/wwoods/dask-actor-singleton
Author: Walt Woods
Author-email: woodswalben@gmail.com
License: UNKNOWN
Description: dask-actor-singleton
        ====================
        
        This package works around common transient errors and pitfalls in creating a singleton instance of an [Actor](https://distributed.dask.org/en/latest/actors.html) in [Dask](https://docs.dask.org/en/latest/). It provides a clean interface for retrieving the singleton instance, and allocating it when necessary.
        
        Usage
        -----
        
        ```python
        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
        # If ever the singleton should be deleted, one may call:
        dask_actor_singleton.discard('my_actor')
        ```
        
        History
        -------
        * 2021-07-29 v1.1 release. Supports `discard` to purge a cached singleton.
        * 2021-07-19 v1.0 release.
        
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
