HarmonyOS taskpool里能执行http请求吗?

HarmonyOS
2024-12-27 14:00:08
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
Heiang

taskpool里能执行http请求。

let promise1 = https.get(xxx).then((data)=>{xxx}) 
let promise2 = https.post(xxx).then((data)=>{xxx}) 
Promise.all([promise1,promise2]).then(()=>{// 这里2个请求都做完了,可以走并行操作})

目前应用多线程有数量限制,网络请求这块推荐使用promise来进行处理。

分享
微博
QQ
微信
回复
2024-12-27 16:23:11
相关问题
HarmonyOS http请求有同步的方式
1289浏览 • 1回复 待解决
封装HTTP请求在ArkTS中常见
4946浏览 • 1回复 已解决
HarmonyOS 取消http请求
1816浏览 • 1回复 待解决
HarmonyOS http请求封装
1302浏览 • 1回复 待解决
HarmonyOS http请求的封装
1293浏览 • 1回复 待解决
如何利用taskpool执行多任务
3281浏览 • 1回复 待解决
HarmonyOS Context在taskpool怎么获取
1070浏览 • 1回复 待解决
HarmonyOS http请求返回2300007
2697浏览 • 1回复 待解决
有使用http发送xml报文格式的请求
3058浏览 • 1回复 待解决
HarmonyOS Http请求头问题咨询
1530浏览 • 1回复 待解决
HarmonyOS http post请求参数传递
1560浏览 • 1回复 待解决
HarmonyOS taskpool无法执行C++代码
1416浏览 • 1回复 待解决