Re:Python 3.6 – Asynchronous Comprehensions
by yladiz on Saturday December 10, 2016 @08:36PM
(#13149091)
I could see it being useful for gathering data via an API and returning it in an array, like if an API doesn't return an array of JSON objects but just an object, this could be useful for that use case. In general as long as it's not processor bound like computational tasks but may not be synchronous this could be useful. It also naturally extends the async for syntax to list comprehension.
It would be really nice if somehow these kinds of tasks could be tied into the multiprocessing package, so that async could handle processor intensive applications well.
Re:Python 3.6 – Asynchronous Comprehensions
by rjbwork on Saturday December 10, 2016 @08:49PM
(#13149127)
This. This is essentially what you can do with the AsParallel() LINQ method, or iterating over an IEnumerable of tasks generated by async methods does in C#.
It would be really nice if somehow these kinds of tasks could be tied into the multiprocessing package, so that async could handle processor intensive applications well.