复制完成后,CloudBlockBlob.StartCopyAsync是否返回? [英] Does CloudBlockBlob.StartCopyAsync return when the copy is completed?
问题描述
有几种方法可以复制天蓝色的blob存储块.有StartCopy
的同步和异步版本.还有一个BeginStartCopy
也具有完成回调.
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.
BeginStartCopy
方法明确声明在复制完成后执行回调.
The BeginStartCopy
approach explicitly states that the callback is executed when the copy has completed.
StartCopy
都使用这两种方法声明它们返回一个字符串,这是一个复制进程ID-他们没有声明在复制完成后返回它们.
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.
在实际复制完成后,那些StartCopy
方法是否返回?
Do those StartCopy
methods return after the actual copy has completed?
推荐答案
在Azure Blob存储服务上启动时,StartCopy()
和await StartCopyAsync()
都返回.在Azure Blob存储服务上启动副本时,也会执行BeginStartCopy()
的完成回调.
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.
最后,StartCopy
(包括上述所有3个版本)是一个异步API,您需要定期自己调用FetchAttributes()
以获得最新的复制进度.
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.
以下是您可以参考的答案: https://stackoverflow.com/a/47651946/2995449
Here is an answer that you can refer to: https://stackoverflow.com/a/47651946/2995449
这篇关于复制完成后,CloudBlockBlob.StartCopyAsync是否返回?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!