Closed Bewinxed closed 2 years ago
You cannot pass to a pool a coroutine as it cannot ship it to the child process/thread. You can see how to do it with concurrent.futures
and asyncio
in the following documentation:
https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor
Unfortunately, Pebble does not currently support asyncio
. It's in the roadmap and I'll try to work on it in the upcoming weeks.
Issue resolved with release 5.0.0
.
I have the following code:
I'm trying to run it using pebble, syncCollectionStats is an async function so I need to make it awaitable somehow, I tried wrapping future, running in executor, but it keeps telling me something about not being able to pickle a coroutine, I've tried a lot but can't seem to get it to work.
The goal is to run the function on each item in trackerCollections where each separate instance of the function takes no longer than 60 seconds, and run the complete queue through a separate process pool.
also what's the difference between map and schedule?
Thank you!