InheritableThread(target: Callable, *args: Any, **kwargs: Any)¶
Thread that is recommended to be used in PySpark instead of
threading.Threadwhen the pinned thread mode is enabled. The usage of this class is exactly same as
threading.Threadbut correctly inherits the inheritable properties specific to JVM thread such as
Also, note that pinned thread mode does not close the connection from Python to JVM when the thread is finished in the Python side. With this class, Python garbage-collects the Python thread instance and also closes the connection which finishes JVM thread correctly.
When the pinned thread mode is off, this works as
This API is experimental.
Return whether the thread is alive.
Wait until the thread terminates.
Method representing the thread’s activity.
Start the thread’s activity.
A boolean value indicating whether this thread is a daemon thread.
Thread identifier of this thread or None if it has not been started.
A string used for identification purposes only.
Native integral thread ID of this thread, or None if it has not been started.