/ unidist / threadsafedict.py / ThreadSafeDict
A thread-safe dictionary. Subclassed from UserDict.
NOTE(g): Does not implement __iter__, so keys() is used instead. __iter__
is inherently thread-unsafe, or requires blocking for a period of time
which is not worth it. Design accordingly.
Methods
|
|
|
__delitem__
|
__delitem__ ( self, key )
Delete an item.
|
|
__getitem__
|
__getitem__ ( self, key )
Get an item.
|
|
__contains__
|
__contains__ ( self, key )
|
|
keys
|
keys ( self )
Return keys.
|
|
__setitem__
|
__setitem__ (
self,
key,
value,
)
Set an item.
|
|
iteritems
|
iteritems ( self )
|
|
GetSet
|
GetSet (
self,
key,
value,
)
Atomically sets a value, and returns the original value.
|
|
__init__
|
__init__ ( self, initialdata=None )
|
|
|