Does CloudBlockBlob.StartCopyAsync return when the copy is completed?

爱⌒轻易说出口 提交于 2019-12-12 12:05:35

问题


There are several ways to copy azure blob storage blocks around. There's a synchronous and asynchronous version of StartCopy. There is also a BeginStartCopy which also has the completion callback.

The BeginStartCopy approach explicitly states that the callback is executed when the copy has completed.

The StartCopy approaches both state that they return a string, which is a copy process id - they don't state that they return when the copy has completed.

Do those StartCopy methods return after the actual copy has completed?


回答1:


Both StartCopy() and await StartCopyAsync() return when the copy is started on Azure Blob Storage service. The completion callback of BeginStartCopy() is also executed when the copy is started on Azure Blob Storage service.

In conclusion, StartCopy (including all 3 versions above) is an asynchronous API, you need to call FetchAttributes() periodically by yourself to get the latest copy progress.

Here is an answer that you can refer to: https://stackoverflow.com/a/47651946/2995449



来源:https://stackoverflow.com/questions/52503777/does-cloudblockblob-startcopyasync-return-when-the-copy-is-completed

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