Groups
Groups
Sign in
Groups
Groups
Wind.js User Groups
Conversations
About
Send feedback
Help
$await可否加一个超时的功能呀?
22 views
Skip to first unread message
胡浩
unread,
Sep 20, 2012, 9:36:52 PM
9/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to win...@googlegroups.com
比如 $await(async_task, 2000)表示async_task异步执行,并且等待2秒
hubert
unread,
Sep 21, 2012, 3:06:12 AM
9/21/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to win...@googlegroups.com
在 async_task 里面写一句 $await(Wind.Async.sleep(interval)); 不就行了
在 2012年9月21日星期五UTC+8上午9时36分52秒,胡浩写道:
比如 $await(async_task, 2000)表示async_task异步执行,并且等待2秒
Jeffrey Zhao
unread,
Sep 21, 2012, 11:33:22 AM
9/21/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to win...@googlegroups.com
其实超时就是配合sleep和whenAny一起使用就行了,假如先结束的时sleep,那么自然说明超时了,否则就是成功。我没有提供内置的超时方法,主要是不知道怎么设计API比较好,因为超时往往会涉及到取消任务什么,但是并非所有的任务都需要/能够取消,所以就由用户自己组合了……
老赵 | Jeffrey Zhao
Blog:
http://blog.zhaojie.me/
GitHub:
https://github.com/JeffreyZhao
From:
胡浩
Sent:
Friday, September 21, 2012 9:36 AM
To:
win...@googlegroups.com
Subject:
[windjs] $await可否加一个超时的功能呀?
比如 $await(async_task, 2000)表示async_task异步执行,并且等待2秒 --
Reply all
Reply to author
Forward
0 new messages