Working on a project where we want to both receive telegram messages and respond to user inputs
Wanted to see if there's a good way to incorporate this using coroutines / asyncio i.e. maybe wrap both the message_loop and user input polling in asyncio.async functions to manage concurrency
Have done a bunch of test programs but getting stuck on reworking the stacked calls with receiver.message(message_loop(sender))... doesn't seem to like yielding control so far
Working on a project where we want to both receive telegram messages and respond to user inputs
Wanted to see if there's a good way to incorporate this using coroutines / asyncio i.e. maybe wrap both the message_loop and user input polling in asyncio.async functions to manage concurrency
asyncio.async(user_input()) asyncio.async(message_loop()) asyncio.get_event_loop().run_forever()
Have done a bunch of test programs but getting stuck on reworking the stacked calls with receiver.message(message_loop(sender))... doesn't seem to like yielding control so far
Any ideas?