g'day you wonderful prefect people! i was wondering if task.map was necessary to use in async projects where you can execute the tasks in a list comprehension and perform an asyncio.gather to achieve the same result? is there anything special about task.map or is it essentially just for sync projects to have concurrency?
t
Tim Galvin
02/01/2024, 8:12 AM
You can do the same thing in the synchronise case as well, but use the
PrefectFuture.result()
type approach to collect the results.
The big difference though (as I understand things) is that the
.map
is easier on the RESTful api as it can be made in one go, as oppossed to many individual small requests.
How much of an ultimate difference that makes I do not know though
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.