当前位置:网站首页>Web worker poll request
Web worker poll request
2022-06-28 15:10:00 【Feng, Feng】
// this.timer.terminate(); close 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 = () => {
// polling
};
this.timer.postMessage("init");
},
边栏推荐
- 利用MySqlBulkLoader实现批量插入数据的示例详解
- 叮!Techo Day 腾讯技术开放日如约而至!
- How to solve the following problems in the Seata database?
- 美国乔布斯,殁了;中国乔布斯,卖了
- Power battery is divided up like this
- GBASE南大通用亮相第六届世界智能大会
- 从莫高窟到太平洋,海量数据找到了新家园
- PMP认证证书的续证费用是多少?
- Calculator (force buckle)
- With 120billion yuan, she will ring the bell for IPO again
猜你喜欢
MIPS汇编语言学习-02-逻辑判断-前台输入
Express模板引擎
Softing epGate PB系列网关-可将PROFIBUS总线集成到EtherNet/IP网络
ORACLE中dbms_output.put_line输出问题的解决过程
论文解读(GCC)《Efficient Graph Convolution for Joint Node RepresentationLearning and Clustering》
Softing epgate Pb series Gateway - integrates the Profibus bus into the ethernet/ip network
Q-tester 3.2: applicable to development, production and after-sales diagnostic test software
Oracle11g database uses expdp to back up data every week and upload it to the backup server
美国乔布斯,殁了;中国乔布斯,卖了
教育行业SaaS应用管理平台解决方案:助力企业实现经营、管理一体化
随机推荐
从莫高窟到太平洋,海量数据找到了新家园
Q-tester 3.2: applicable to development, production and after-sales diagnostic test software
使用LamdbaUpdateWrapper的setSql作用及风险
利用MySqlBulkLoader实现批量插入数据的示例详解
Vector explanation + topic
Does Frankfurt currently support SQL?
[MySQL learning notes 23] index optimization
Setsql function and risk of using lamdbaupdatewrapper
PMP认证证书的续证费用是多少?
open3d里pointcloud和numpy数组之间的转化
Classmate Zhang hasn't learned to be an anchor yet
Successful cases of rights protection of open source projects: successful rights protection of SPuG open source operation and maintenance platform
With a return of 5000 times, the South African newspaper invested in Tencent to make a province
What are the benefits of this PMP certificate?
抽奖动画 - 鲤鱼跳龙门
[C language] implementation of binary tree and three Traversals
ROS知识点——ROS创建工作空间
实验6 8255并行接口实验【微机原理】【实验】
Express template engine
[C language] how to implement plural types