Being Cellfish

Stuff I wished I've found in some blog (and sometimes did)

Asynchronous enumerations - Part 1: Task<IEnumerable<T>>

Change of Address
This blog has moved to

Asynchronous enumerations - Part 1: Task<IEnumerable<T>>

Rate This
  • Comments 2

For background, read the introduction.

If you need all data before you start processing it or if you expect just a few records each time, then this is probably your simplest way to get an "asynchronous enumeration". Technically the enumeration is not asynchronous since you retrieve all data asynchronously first and then process it. You can also easily use LINQ on the enumeration for processing which is very nice.

The only real drawback is that you're not flexible in case you one day will retrieve a lot of data (or no longer need al data at once for processing). If you have those needs from day one, then this is not the option for you I think.

  • Shortest blog post I have ever read!

  • Poderia ser melhor...

Page 1 of 1 (2 items)