Hi <@U021J8TU753>, With prefect 3.0 now having di...
# ask-community
c
Hi @Prefect, With prefect 3.0 now having differences with task.submit, how do i submit three tasks asynchronously without throwing an error? For example, taskA.submit() taskB.submit() taskC.submit() should submit at the same time. This worked in 2.0, but Im getting an error in 3.0
n
the only difference should be that
submit
is a sync call now. depending on which version of the rc you have, even `await`ing submit should work and throw a deprecation message
Copy code
In [1]: from prefect import flow, task

In [2]: @task
   ...: def add(a: int, b: int) -> int:
   ...:     return a + b
   ...:

In [3]: @flow
   ...: def f():
   ...:     futures = add.map([1, 2, 3], [2, 3, 4])
   ...:     return [f.result() for f in futures]
   ...:

In [4]: f()
07:16:33.987 | INFO    | prefect.engine - Created flow run 'armored-copperhead' for flow 'f'
...
07:16:35.862 | INFO    | Task run 'add-0' - Finished in state Completed()
07:16:35.866 | INFO    | Task run 'add-2' - Finished in state Completed()
07:16:35.886 | INFO    | Task run 'add-1' - Finished in state Completed()
07:16:36.105 | INFO    | Flow run 'armored-copperhead' - Finished in state Completed()
Out[4]: [3, 5, 7]
can you share what error you got?