windmill icon indicating copy to clipboard operation
windmill copied to clipboard

feature: Support calling async main python functions directly

Open ericxl opened this issue 2 years ago • 1 comments

Please support calling async python function directly for Apps or scripts. Currently you have to wrap it in a asyncio.run. This would be a big quality-of-life improvements because most of our library scripts are in async.

Looks like another request from Discord earlier: https://discord.com/channels/930051556043276338/1180439258683691008/1180439258683691008

ericxl avatar Dec 29 '23 19:12 ericxl

We haven't implemented it yet but to anyone finding this, you can run async def function in windmill, but you have to wrap them first:

import asyncio

def run main():
    asyncio.run(async_main())

async def async_main():
    ...your_code

rubenfiszel avatar Jan 13 '24 12:01 rubenfiszel