Skip to content

Allow using cocoutines (and await) in actions #413

@almarklein

Description

@almarklein

In #408 we base the event loop on asyncio, which opens up the possibility to use async and await in tests. At this point, we cannot write actions or reactions as co-routines. Reactions can probably not be co-routines, since the state needs to be constant while processing (a batch of) reactions. But we can probably allow actions to be co-routines.

Implementation-wise, the event system will need to check whether an action-function is actually a co-routine and pass it to asyncio if it is. This will only work for PyComponents, unless we add some sort of async support to pyscript.

Then we can make use of tools from aio-libs, like aiohttp.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions