当前位置:网站首页>web Worker 轮询请求
web Worker 轮询请求
2022-06-28 15:05:00 【Feng、锋】
// this.timer.terminate(); 关闭worker
timerWorker() {
console.log("timerWorker");
function createWorker(f) {
let blob = new Blob(["(" + f.toString() + ")()"]);
let url = window.URL.createObjectURL(blob);
let worker = new Worker(url);
return worker;
}
this.timer = createWorker(() => {
setInterval(() => {
self.postMessage("timer");
}, 1000);
});
this.timer.onmessage = () => {
// 轮询
};
this.timer.postMessage("init");
},
边栏推荐
- 5000倍回报,南非报业投资腾讯赚了一个省
- 鸟类飞行状态下穿戴式神经信号与行为数据检测记录系统的技术难点总结
- Oracle11g database uses expdp to back up data every week and upload it to the backup server
- How does Seata server 1.5.0 support mysql8.0?
- open3d里pointcloud和numpy数组之间的转化
- Jingyuan's safe sprint to the Growth Enterprise Market: it plans to raise 400million yuan for investment and Yunyou software is the shareholder
- High "green premium" of environmental protection products? How far is the low-carbon lifestyle from people
- [MySQL learning notes 24] index design principles
- 浪擎与浪潮,一个从OEM到价值共生的生态样板
- Steve Jobs of the United States, died; China jobs, sold
猜你喜欢

2022年最新PyCharm激活破解码永久_详细安装教程(适用多版本)

Halcon basic summary (I) cutting pictures and rotating images

Express模板引擎
ORACLE中dbms_output.put_line输出问题的解决过程

WPF 视频硬解码渲染播放(无空域)(支持4K、8K、高帧率视频)
Oracle11g database uses expdp to back up data every week and upload it to the backup server

With 120billion yuan, she will ring the bell for IPO again

Not being a meta universe now is like not buying a house 20 years ago!
PostgreSQL实现按年、月、日、周、时、分、秒的分组统计
MySQL主从切换的超详细步骤
随机推荐
Jingyuan's safe sprint to the Growth Enterprise Market: it plans to raise 400million yuan for investment and Yunyou software is the shareholder
Construction and management practice of ByteDance buried point data flow
Facebook! Adaptive gradient defeats manual parameter adjustment
【算法篇】刷了两道大厂面试题,含泪 ”重学数组“
R语言ggplot2可视化:使用patchwork包将两个ggplot2可视化结果横向构成新的结果可视化组合图(使用|符号)
Performance comparison of deep learning models on cat and dog image data sets
Classmate Zhang hasn't learned to be an anchor yet
智能化转型被加速,企业需要新的工具箱
Oracle11g数据库使用expdp每周进行数据备份并上传到备份服务器
open3d里pointcloud和numpy数组之间的转化
Leetcode (406) - rebuild the queue based on height
R语言ggplot2可视化:patchwork包将一个ggplot2可视化结果和一个plot函数可视化结果横向组合起来形成最终结果图、两个可视化的组合结果对齐、并为组合图像的每个子图添加标题
halcon 基础总结(一)裁切图片并旋转图像
法兰克福地区目前支持sql了吗?
成龙和快品牌,谁才是快手的救星?
PMP真的有用吗?
dolphinscheduler2.X的安装(亲测有效)
股票开户优惠链接,我如何才能得到?手机开户是安全么?
Softing epGate PB系列网关-可将PROFIBUS总线集成到EtherNet/IP网络
With 120billion yuan, she will ring the bell for IPO again