Skip to content

Unable to run concurrent asyncio processes #396

Open
@ifeldshteyn-emc

Description

@ifeldshteyn-emc

Hi,

The bot is unable to handle asyncio concurrent messagefunction calls. If you add sleep to any listen function - the bot will be unable to handle any other messages until the sleep is released.

Here is an example. If you type !test to the bot it will enter the function test and sleep for 5 seconds. If during those 5 seconds you tell the bot !hi it won't reply to you until the !test function is released.

Expected functionality would be ability to handle multiple requests concurrently

    @listen_to("^!test")
    async def test(self, message: Message):
        self.driver.reply_to(message, "Start Sleep")
        time.sleep(5)
        self.driver.reply_to(message, "End Sleep")

    @listen_to("^!hi")
    async def hi(self, message: Message):
        self.driver.reply_to(message, "Hello")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions