MCPcopy Create free account
hub / github.com/closeio/tasktiger / external_worker

Function external_worker

tests/utils.py:73–87  ·  view source on GitHub ↗

Runs a worker. To be used with multiprocessing.Pool.map.

(n=None, patch_config=None, worker_kwargs=None)

Source from the content-addressed store, hash-verified

71
72
73def external_worker(n=None, patch_config=None, worker_kwargs=None):
74 """
75 Runs a worker. To be used with multiprocessing.Pool.map.
76 """
77 tiger = get_tiger()
78
79 if patch_config:
80 tiger.config.update(patch_config)
81
82 if worker_kwargs is None:
83 worker_kwargs = {}
84
85 Worker(tiger, **worker_kwargs).run(once=True, force_once=True)
86
87 tiger.connection.close()
88
89
90def sleep_until_next_second():

Callers

nothing calls this directly

Calls 3

WorkerClass · 0.90
get_tigerFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected