async deno:异步原始模块从Python的Deno的asyncio松散移植 源码

yes_98762 7 0 ZIP 2021-04-23 18:04:17

异步术语 异步原始模块从松散端口为。 用法 锁 锁可用于保证对共享资源的独占访问。 import { Lock } from "https://deno.land/x/async/mod.ts" ; import { delay } from "https://deno.land/std@0.86.0/async/mod.ts" ; const lock = new Lock ( ) ; const task1 = async ( ) => { await lock . with ( async ( ) => { await delay ( 50 ) ; console . log ( "Task1 start" ) ; await delay ( 100 ) ; console . log ( "Task1 end" ) ; } ) ; } ;

用户评论
请输入评论内容
评分:
Generic placeholder image 卡了网匿名网友 2019-06-05 01:06:27

不能连接.能创建

Generic placeholder image 卡了网匿名网友 2019-06-05 01:06:27

学习一下!!!

Generic placeholder image 卡了网匿名网友 2019-06-05 01:06:27

还可以吧,对自己

Generic placeholder image 卡了网匿名网友 2019-06-05 01:06:27

学习一下,看下效果

Generic placeholder image 卡了网匿名网友 2019-06-05 01:06:27

学习一下,为题未解决!

Generic placeholder image 卡了网匿名网友 2019-06-05 01:06:27

还可以 值得学习参考

Generic placeholder image 卡了网匿名网友 2019-06-05 01:06:27

还可以吧,对自己来说用处不大