如何等待事件所调用的函数的整个过程的完成?
我有一个事件触发的函数,即使事件是其他时间触发的,是否有任何方法可以等待该功能的整个过程完成,因此只有在此之后它继续处理其他触发器收到的其他触发器?
I have a function that is triggered by an event, is there any way to wait for the completion of the entire process of this function, even if the event is triggered other times, so that only after that it continues processing the other triggers received?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我了解,您需要一些队列。您需要将事件推到那里,然后对它们进行处理。也许这样的东西:
As far as I understood you need some sort of a queue. You need to push events there and process them one by one. Maybe something like this:
我设法找到了这样的解决方案:
I managed to find a solution like this: