Skip to content

Testing For / Default distributed.Variable Value #5830

@jamesstidard

Description

@jamesstidard

Hi,

I'm hoping to use distributed.Varaible as a read counter for a Read/Write Lock I'm building from Dasks synchronisation primitives.

Is there a way to test for the existence of a variable before calling distributed.Varaible.get on it? Or without having to call distributed.Varaible.set and overriding a potentially already set value?

At the moment, calling distributed.Varaible.get before a distributed.Varaible.set will block.

If there's not a way to test if the variable already has a set value under a name, would it be possible to add that, or maybe have a option in either get or set for a default value to be returned if none set (akin to dict.setdefault or dict.get(key, default)?

Thanks.

EDIT: returning distributed.Varaible.get returning None or raising a Exception would also be fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions