问题
The Azure Storage client was recently updated to version 2.0, and I haven't found any API that returns Task.
How can I use TPL with Table Storage? .. Blob or Queue?
For your reference the new API has an example here for Table Storage.
回答1:
Looking through some of the source under https://github.com/WindowsAzure/azure-sdk-for-net/ it appears that they haven't had a chance to add the Task versions yet (seems odd since it specifically mentions targeting .NET 4), but the operations appear to have the Begin* and End* versions available, so you could use the FromAsync method to wrap each pair in a task for easier consumption.
Does seem like an odd omission AFAICT, though.
来源:https://stackoverflow.com/questions/13216475/how-can-i-use-tpl-with-the-new-apis-in-azure-storageclient-2-0-and-newer