Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Usage with asyncio #123

@dendendd

Description

@dendendd

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions