复制完成后,CloudBlockBlob.StartCopyAsync是否返回? [英] Does CloudBlockBlob.StartCopyAsync return when the copy is completed?

查看:77
本文介绍了复制完成后,CloudBlockBlob.StartCopyAsync是否返回?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有几种方法可以复制天蓝色的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆