components.PicklableBase

class components.PicklableBase

Bases: object

A base class for objects using locks for thread safety. All locks must have names ending on _lock.

__getstate__()

Gets called, when object is being pickled. Sets all variables ending on _lock to None.

Returns: The dictionary describing the current state of the object.

Return type

Dict[str, Any]

__setstate__(state)

Gets called, when object is being un-pickled. Sets all variables ending on _lock to a new threading.Lock instance.

Parameters

state (Dict[str, Any]) – The pickled state of the object as produced by __getstate__().

Return type

None