Jean-Baptiste Six

    Jean-Baptiste Six

    10 months ago
    Hello 🙂 I'm new with Prefect and I'd like to know if it's possible to combine it with async ? I need smth like this:
    @task
    async def mytask1():
        await do_smth()
    
    @task
    async def mytask2():
        await do_smth()
    
    async def my_flow():
        with Flow("Test") as flow:
            await mytask1()
            mytask2()
    
        flow.run()
    The goal is to be able to execute async functions, my flows will be synchronous between them
    Kevin Kho

    Kevin Kho

    10 months ago
    Hey @Jean-Baptiste Six, not in the current Prefect. All async stuff has to happen inside the task. This is native in Orion (Prefect 2.0) though. Check the docs here
    Jean-Baptiste Six

    Jean-Baptiste Six

    10 months ago
    @Luis Arias FYI 😕
    Kevin Kho

    Kevin Kho

    10 months ago
    For current Prefect usage, check this archived chat
    Jean-Baptiste Six

    Jean-Baptiste Six

    10 months ago
    Thanks for the answer 🙂