Skip to main content

current_process_index

Retrieves the index of the current process and adds a base offset, returning None if the process index is not available.

def current_process_index(
base: integer = 1
) - > integer or null

Retrieves the index of the current process, typically used in multiprocessing contexts to identify specific worker instances.

Parameters

NameTypeDescription
baseinteger = 1The starting value added to the process index, commonly used to switch between 0-based and 1-based indexing.

Returns

TypeDescription
integer or nullThe process index offset by the base value, or null if the current process does not have an index attribute assigned.