Last active
November 24, 2020 13:15
-
-
Save amacal/4fbed44779b502c7fc9ace22992b77c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from queue import Queue | |
from asyncio import get_running_loop, wait, run | |
from concurrent.futures import ThreadPoolExecutor | |
async def main(): | |
tasks = [] | |
loop = get_running_loop() | |
ftpQueue = Queue() | |
jsonQueue = Queue() | |
with ThreadPoolExecutor(max_workers=20) as executor: | |
for item in fetch_names(): | |
tasks.append(loop.run_in_executor(executor, master, ..., ftpQueue, jsonQueue)) | |
await wait(tasks) | |
run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment