当前位置:网站首页>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");
},
边栏推荐
- [collection of excellent articles on Digital IC] nearly 500 articles | learning route | basic knowledge | interface | bus | scripting language | chip job search | security | EDA | tools | low power de
- How can I get the stock account opening discount link? Is it safe to open a mobile account?
- Vector explanation + topic
- Setsql function and risk of using lamdbaupdatewrapper
- 抽奖动画 - 鲤鱼跳龙门
- vscode编写markdown文件并生成pdf
- Oracle11g数据库使用expdp每周进行数据备份并上传到备份服务器
- Jingyuan's safe sprint to the Growth Enterprise Market: it plans to raise 400million yuan for investment and Yunyou software is the shareholder
- seata-server 1.5.0 如何支持mysql8.0?
- [MySQL learning notes 24] index design principles
猜你喜欢

After QQ was stolen, a large number of users "died"

Introduction to common components of IOT low code platform

New offline retail stores take off against the trend, and consumption enthusiasm under the dark cloud of inflation

MIPS汇编语言学习-03-循环

Jackie Chan and fast brand, who is the Savior of Kwai?

字节跳动埋点数据流建设与治理实践

【算法篇】刷了两道大厂面试题,含泪 ”重学数组“

With a return of 5000 times, the South African newspaper invested in Tencent to make a province
![[C language] implementation of binary tree and three Traversals](/img/9f/384a73fb82265a76fc5eef884ce279.png)
[C language] implementation of binary tree and three Traversals

论文解读(GCC)《Efficient Graph Convolution for Joint Node RepresentationLearning and Clustering》
随机推荐
Case driven: a detailed guide from getting started to mastering shell programming
[C language] how to generate normal or Gaussian random numbers
How to solve the following problems in the Seata database?
Leetcode (665) -- non decreasing column
蔚来潜藏的危机:过去、现在到未来
What is the renewal fee for PMP certificate?
Leetcode 48. Rotate image (yes, resolved)
Combined sum leetcode
计算器(力扣)
Unable to create process using 'd:\program file
云杉网络DeepFlow帮助5G核心网和电信云构建可观测性
【mysql学习笔记24】索引设计原则
当下不做元宇宙,就像20年前没买房!
【mysql学习笔记23】索引优化
利用MySqlBulkLoader实现批量插入数据的示例详解
What are the benefits of this PMP certificate?
叮!Techo Day 腾讯技术开放日如约而至!
兼顾企业抗疫和发展的5个解决方案,来自IBM
ROS知识点——话题消息的定义与使用
Le patron a donné trois ordres: discret, discret, discret