PRISM:创建异步方法的管道

发布于 2024-09-29 14:04:39 字数 234 浏览 0 评论 0原文

我想知道是否有人可以在这里帮助我: 我正在尝试创建命令的“管道”或“队列”[类似于 Prism 中的 CompositeCommand],但我希望它是顺序的,即使正在执行的命令本质上是异步的。

基本上,我想将一堆异步调用串在一起[不是在编译时而是在运行时],并且我想要类似于 CompositeCommand 功能的东西,我可以在其中轻松注册和取消注册调用。

对此的任何帮助/见解都非常感谢。

谢谢, 拉维

I am wondering if anyone can help me with something here:
I am trying to create a "pipeline" or "queue" of commands [similar to CompositeCommand in Prism] except I want it to be sequential even if the command being executed is Asynchronous in nature.

Basically, I want to string together bunch of Async calls [not at compile time but at run time] and I want something similar to CompositeCommand functionality where I can easily register and unregister calls.

Any help/insight into this is greatly appreciated.

Thanks,
Ravi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清晰传感 2024-10-06 14:04:39

查看 Caliburn Micro 中的协程实现。

http://caliburnmicro.codeplex.com/wikipage?title= IResult%20and%20Coroutines&referringTitle=Documentation

您还可以观看 Rob 在今年的 Mix 视频中描述协程。

http://live.visitmix.com/MIX10/Sessions/EX15

或 ..如果您被允许走在最前沿,今天刚刚宣布的是下一版本框架中的 async 和 wait 关键字。在这里阅读相关内容:

链接

希望有帮助。

check out the coroutine implementation in Caliburn Micro.

http://caliburnmicro.codeplex.com/wikipage?title=IResult%20and%20Coroutines&referringTitle=Documentation

You can also watch Rob describe coroutines in his video from Mix this year.

http://live.visitmix.com/MIX10/Sessions/EX15

Or ... if you're allowed to be on the cutting edge, just announced today are the async and await keywords in the next version of the framework. Read about that here:

Link

Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文