0

I am using ConversationHandler to manage my boot's states.
I also have some timers there, so i am using JobQueue that for. Also i have web application where user can perform some tasks, after tasks complete i whant it (site) to send notification to user from bot. To interconnect between user and telegram bot i decided to use ZeroMQ (using this example https://gist.github.com/ramn/7061042)
But, i need to run listener somehow async in my bot's code, otherwise it didn't event start to execute due bot's start_polling function. I did try to do it using JobQueue and it worked great, but it stops all the JobQueue queue =(
How can i manage this interconnection? Should i stop using JobQueue and move to some celery-like library?

Thanks!

Timopheym
  • 363
  • 3
  • 15

1 Answers1

1

I am not sure if this would completely help, but python-telegram-bot has a @run_async decorator which provides you extra threads for async functions. You can do from telegram.ext.dispatcher import run_async and then decorate the job function.

More details can be found in the wiki here.

jeffffc
  • 772
  • 4
  • 13