Threading Module¶
A module with threading related utilities
ThreadLocal(default_factory=None)
¶
Bases: Generic[T]
A thread local value holder
clear()
¶
clear the value in the current thread
get()
¶
return the current value or invoke the optional factory to compute one
Returns:
Type | Description |
---|---|
Optional[T]
|
Optional[T]: the value associated with the current thread |
set(value)
¶
set a value in the current thread
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
T
|
the value |
required |