How can I use TPL with the new APIs in Azure StorageClient 2.0 and newer?

梦想与她 提交于 2019-12-11 14:09:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!