开发者

In puremvc, how to wait for sendNotification/notifyObservers finishes

开发者 https://www.devze.com 2023-03-09 06:49 出处:网络
In PureMVC / ActionScr开发者_如何转开发ipt, after sending out notifications using send Notification or notify-observers, how do I make sure all the observers has received the notification and finished

In PureMVC / ActionScr开发者_如何转开发ipt, after sending out notifications using send Notification or notify-observers, how do I make sure all the observers has received the notification and finished the work?

On the other words, is sendNotification in synchronized way.

Thanks


As far as I know, the proper way to do this is to put all of your tasks in SimpleCommands, and then add all of these to a single MacroCommand. As long as the SimpleCommands are synchronous (eg, you don't start any load processes), when the MacroCommand finished, you are guaranteed that all of the SimpleCommands in it have finished.

You may also want to investigate the AsyncCommand utility. I am not a huge fan of this, but some of my colleagues like it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号