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.
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.geton it? Or without having to calldistributed.Varaible.setand overriding a potentially already set value?At the moment, calling
distributed.Varaible.getbefore adistributed.Varaible.setwill 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.setdefaultordict.get(key, default)?Thanks.
EDIT: returning
distributed.Varaible.getreturning None or raising a Exception would also be fine.