mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 23:21:22 -07:00
Move queuing tasks to a background thread
This commit is contained in:
parent
9ecec6c28e
commit
b71957d6e6
8 changed files with 226 additions and 156 deletions
|
@ -64,12 +64,12 @@ class WorkerProcess(multiprocessing.Process):
|
|||
for reading later.
|
||||
'''
|
||||
|
||||
def __init__(self, rslt_q, task_vars, host, task, play_context, loader, variable_manager, shared_loader_obj):
|
||||
def __init__(self, rslt_q, play, host, task, task_vars, play_context, loader, variable_manager, shared_loader_obj):
|
||||
|
||||
super(WorkerProcess, self).__init__()
|
||||
# takes a task queue manager as the sole param:
|
||||
self._rslt_q = rslt_q
|
||||
self._task_vars = task_vars
|
||||
self._play = play
|
||||
self._host = host
|
||||
self._task = task
|
||||
self._play_context = play_context
|
||||
|
@ -77,6 +77,8 @@ class WorkerProcess(multiprocessing.Process):
|
|||
self._variable_manager = variable_manager
|
||||
self._shared_loader_obj = shared_loader_obj
|
||||
|
||||
self._task_vars = task_vars
|
||||
|
||||
# dupe stdin, if we have one
|
||||
self._new_stdin = sys.stdin
|
||||
try:
|
||||
|
@ -158,3 +160,4 @@ class WorkerProcess(multiprocessing.Process):
|
|||
#with open('worker_%06d.stats' % os.getpid(), 'w') as f:
|
||||
# f.write(s.getvalue())
|
||||
|
||||
sys.exit(0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue