Testing For / Default distributed.Variable Value
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 778
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 3
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.