我已经声明了我的数据对象,queuedItemList: []它应该包含由后台服务提供的一组项目。在 HTTP 请求之后,我使用类似的 for 循环填充列表
for(var i = 0; i < getList.length; i++) {
var newObject = Object.assign({}, getList[i]);
this.queuedItemList.splice(i, 1, newObject);
}
Run Code Online (Sandbox Code Playgroud)
用于填充以下模板
<Item v-for="(item, index) in queuedItemList" :key="index" :componentData="item" :index="index" @remove="removeItem">
</Item>
Run Code Online (Sandbox Code Playgroud)
I am supposed to do a periodic HTTP GET to get the new list of items, which may also contain current items with maybe different state. Inside the component, I am using a v-if to select between two different icons.
<v-icon name="play" class="controlIcons" …Run Code Online (Sandbox Code Playgroud) 我有一个JavaScript程序,希望通过提供RabbitMQ的输入来持续执行。问题在于它有时会无限期地挂起并阻塞整个执行过程。我最初的想法是Promise.race在特定时间段后使用超时并让下一条消息进入,但是损坏的Promise本身仍在后台运行,并且永远不会结束。在此设计中,我将开始生成“僵尸”承诺,这些承诺最终将消耗我的系统资源(因为我的应用程序一直在运行)。我对这个程序真的没有控制权。没有什么abort()可以发送给我的功能了。所以我的问题是:
有没有办法杀死Promise并将其完全从事件循环中删除?
如果不可能,那么将第二个nodejs程序作为子进程生成并在出现问题时将其杀死呢?可以正确清理我的系统资源吗?