def _pool_worker(inqueue, outqueue, host=None):
put = outqueue.put<EOL>get = inqueue.get<EOL>if hasattr(inqueue, '<STR_LIT>'):<EOL><INDENT>inqueue._writer.close()<EOL>outqueue._reader.close()<EOL><DEDENT>if host:<EOL><INDENT>host_port = host.split('<STR_LIT::>')<EOL>try:<EOL><INDENT>host_port = [host_port[<NUM_LIT:0>], int(host_port[<NUM_LIT:1>])]<EOL><DEDENT>except IndexError:<EOL><INDENT>pass<EOL><DEDENT>conn = rpyc.classic.connect(*host_port)<EOL>conn.execute(getsource(imports)) <EOL><DEDENT>while True:<EOL><INDENT>try:<EOL><INDENT>task = get()<EOL><DEDENT>except (EOFError, IOError):<EOL><INDENT>break<EOL><DEDENT>if task is None:<EOL><INDENT>put(None)<EOL>break<EOL><DEDENT>if task[<NUM_LIT:1>] is None:<EOL><INDENT>put(task)<EOL>continue<EOL><DEDENT>job, func, args, kwargs, (i, data) = task<EOL>if host:<EOL><INDENT>func = func._inject(conn) if hasattr(func, '<STR_LIT>') else_inject_func(func, conn)<EOL><DEDENT>try:<EOL><INDENT>ok, result = (True, func(data, *args, **kwargs))<EOL><DEDENT>except Exception as excp:<EOL><INDENT>ok, result = (False, excp)<EOL><DEDENT>put((job, i, ok, result))<EOL><DEDENT>
(internal) Function which is executed by worker pool processes or threads.
It waits for tasks (function, data, arguments) at the input queue "inqueue"
evaluates the result and passes it to the output queue "outqueue". It 
optionally evaluates the function on a remote host.