2
pool.map을 통해 호출하는 함수에 여러 인수를 전달하려면 어떻게해야합니까?Python gevent : pool.map을 통해 호출 된 함수에 여러 인수 전달
내 코드 :
import gevent
from gevent.pool import Pool
def process(param1, param2):
return "dosomething"
pool = Pool(10)
jobs = [('arg1a', 'arg1b'), ('arg2a', 'arg2b')]
# should pass arguments so that it results in these calls
# process(param1=arg1a, param2=arg1b)
# process(param1=arg2a, param2=arg2b)
results = pool.map(process, jobs) # does not work
그것은처럼 보일 수 있습니다' pool.map (풀 (프로세스), 작업)'. 원하면'funcy' 라이브러리에'unpack' 꾸러미를 추가 할 수 있습니다. https://github.com/Suor/funcy/pull/62 – ADR