Git Product home page Git Product logo

dask-actor-singleton's Introduction

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
# If ever the singleton should be deleted, one may call:
dask_actor_singleton.discard('my_actor')

History

  • 2021-08-19 v1.3.3 release. Caching times start after object creation finishes; not at the start. This matters for objects with long load times.
  • 2021-08-18 v1.3.2 release. Explicitly forget wrapped future.
  • 2021-08-18 v1.3.1 release. Free old actor when re-allocating to potentially reduce memory load.
  • 2021-08-02 v1.3.0 release. Priority argument added to improve responsiveness alongside larger processing loads.
  • 2021-07-29 v1.2.0 release. Added TTL support for get, and better documentation for discard.
  • 2021-07-29 v1.1.1 release. Fixed issue with "Working holding Actor was lost"
  • 2021-07-29 v1.1 release. Supports discard to purge a cached singleton.
  • 2021-07-19 v1.0 release.

dask-actor-singleton's People

Contributors

wwoods avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.