Skip to content

Comms with async functions #868

@mlucool

Description

@mlucool

Hi,

Is there a recommendation for when a comm needs to call an async function. While support for #433 would be ideal, the usecase is that there is some async def foo() that needs to be called from within a comm. For now, the best way to work around this was to make it synchronous via (using ideas from ipython/ipython#13670 (comment)):

import nest_asyncio
nest_asyncio.apply()
asyncio.run(foo())

This seems to work, but I didn't know if there was a better way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions