Fix MediaEmptyError error when sending some videos (#3951) (ef4f9a9 by th3c00lw0lf)
The StackOverflow question PyQt, Telethon. How to send a message on button click? prompted me to write a Wrapper to launch async tasks from threaded code. This is in my opinion one of the cleanest way in which you can combine threaded code with async code (a.k.a. Telethon).
Note that I still recommend you to avoid threaded code when possible, and use only async, but if you can't for some reason, this wrapper will setup and manage a new thread just for async code to run. Then you can use as many threads as you want, and communicate safely with the async code via a shared queue.
Note that I still recommend you to avoid threaded code when possible, and use only async, but if you can't for some reason, this wrapper will setup and manage a new thread just for async code to run. Then you can use as many threads as you want, and communicate safely with the async code via a shared queue.
Given the amount of trolls having fun with the reactions here, I've toned them down a bit. If you had a legitimate reason to react with a poop emoji or middle finger, please message me privately argumenting why you think it's a bad idea to disable that reaction, and I may reconsider. If you're a troll though, I'll simply report you and go on with my life.