MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / start_detached

Function start_detached

seleniumbase/undetected/dprocess.py:15–36  ·  view source on GitHub ↗

Starts a fully independent subprocess with no parent. :param executable: executable :param args: arguments to the executable, eg: ["--param1_key=param1_val", "-vvv"] :return: pid of the grandchild process

(executable, *args)

Source from the content-addressed store, hash-verified

13
14
15def start_detached(executable, *args):
16 """Starts a fully independent subprocess with no parent.
17 :param executable: executable
18 :param args: arguments to the executable,
19 eg: ["--param1_key=param1_val", "-vvv"]
20 :return: pid of the grandchild process """
21 import multiprocessing
22
23 reader, writer = multiprocessing.Pipe(False) # Create pipe
24 multiprocessing.Process(
25 target=_start_detached,
26 args=(executable, *args),
27 kwargs={"writer": writer},
28 daemon=True,
29 ).start()
30 # Receive pid from pipe
31 pid = reader.recv()
32 REGISTERED.append(pid)
33 # Close pipes
34 writer.close()
35 reader.close()
36 return pid
37
38
39def _start_detached(executable, *args, writer=None):

Callers 1

__init__Method · 0.85

Calls 2

startMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…