Threading
class Threading
Methods
Calls a Function with a number of number of different parameters via multi-threading.
Starts a function in a new process. Returns the process id of the newly spawned process.. The called function should be self sustained, i.e. you cannot access any return params
No description
Is the current process a child process?
Check Status of a child process
Stops all running child processes
Wait's until all child processes have been finished
Details
at line 42
call_func_multithreaded(callable $function, array $thread_params, int $max_threads = 20, bool|callable $log_callback = false)
Calls a Function with a number of number of different parameters via multi-threading.
A new process is spawned for each item in the $thread_params array, calling the $function and passing the item as the functions parameter. Once $max_threads threads have been spawned, the parent thread waits for child processes to finish before spawning new ones.
at line 97
int
call_user_func_array_in_new_process(callable $function, array $params, mixed $log_callback = false, string $thread_caption = false)
Starts a function in a new process. Returns the process id of the newly spawned process.. The called function should be self sustained, i.e. you cannot access any return params
at line 241
string
getProcessCaption()
No description
at line 234
bool
is_child_process()
Is the current process a child process?
at line 177
bool
is_child_stopped(int $pid, $exit_status, int $wait_timeout = 0)
Check Status of a child process
at line 206
sendSignalToRunningChildren(int $signal = SIGTERM)
Stops all running child processes
at line 216
waitForRunningChildren()
Wait's until all child processes have been finished