来自异步 ASP.NET 页面的多个顺序异步 Web 服务调用?
我需要从异步 ASPX 页面进行 n 次异步 Web 服务调用。
每个 WS 调用都会检索二进制文件的一部分。然后,代码将文件块输出到页面的响应流。
offset = 0;
blocksize = 1024;
output = getFileBlock(path, offset, blocksize);
//BinaryWrite output to Response
offset += blocksize;
output = getFileBlock(path, offset, blocksize);
//BinaryWrite output to Response
//etc...
每个 getFileBlock 都是一个 Web 服务调用,我想将其进行异步。但是,我需要这些调用按特定顺序进行。
有什么建议如何实施?
I need to make n number of async web service calls from an async ASPX page.
Each WS call retrieves a portion of a binary file. The code then outputs the file block to the page's response stream.
offset = 0;
blocksize = 1024;
output = getFileBlock(path, offset, blocksize);
//BinaryWrite output to Response
offset += blocksize;
output = getFileBlock(path, offset, blocksize);
//BinaryWrite output to Response
//etc...
Each getFileBlock is a web service call which I would like to make async. However, I need these calls to happen in a specific order.
Any suggestions how to implement this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用异步函数。在异步完成处理程序中,输出结果,如果仍需要更多数据,请再次调用异步函数。
Call the async function. In the async completion handler, output the result, and if you still need more data, call the async function again.