Flex Caringorm 一次调用多个命令(队列命令)
我想一一调用3个命令,每个命令之间的关系是命令应该在上一个命令结果中一一执行。如何对命令进行排队?处理队列命令的最佳实践是什么,我的要求是添加 n 个命令并执行它们。
Main -> Execute c1
c1 got the Result - Execute c2
c2 got the Result - Execute c3
I want to call 3 commands one by one , the relation between each commands are command should execute one by one in the previous command result. How to Queue Command's? What is the best practice to handle Queue command , my requirement is adding n number of commands and execute them.
Main -> Execute c1
c1 got the Result - Execute c2
c2 got the Result - Execute c3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在构造函数中,您可以定义链接行为
然后在命令的结果处理程序中,您可以调用下一个事件
此行为的参考是 此处。
In your constructor you can define chaining behavior
Then in your result handler of your command you can call the next event
Reference for this behavior is here.
我不相信你可以“排队”命令...我为完成同样的事情所做的事情是在 c1 的结果处理程序中,它将结果附加到启动 c2 的 event2,然后 c2 执行相同的操作事件3和c3。因此,它本身并不是一种排队效应,而是一种连锁效应。
华泰
I don't believe that you can "queue" commands...what I've done to accomplish the same thing is in the result handler of c1, it attaches the result to event2 which kicks off c2, then c2 does the same with event3 and c3. So it isn't a queuing effect per se, but a chaining one.
HTH