Galarzaa90 / NabBot

Discord bot for Tibia servers
https://nabbot.xyz
Apache License 2.0
52 stars 25 forks source link

Run PIL in an executor #89

Closed Galarzaa90 closed 6 years ago

Galarzaa90 commented 6 years ago

Right now, the loot command uses PIL (aka Pillow) inside coroutines, but PIL itself is blocking.

It needs to be run in an executor so a new thread is created for this.

await loop.run_in_executor(None, sync_func, *args)