Commit graph

35 commits

Author SHA1 Message Date
Matthew Wild
a8f9a2757f util.async: Make parameters to async.runner() optional 2018-03-23 14:02:33 +00:00
Kim Alvefur
98482848ca util.async: Use wrapper for once runner (thanks luacheck) 2018-03-22 23:15:04 +01:00
Matthew Wild
d99a87a40c util.async: Allow nil as a guard key 2018-03-22 16:26:09 +00:00
Matthew Wild
6a62730359 util.async: Add sleep() method 2018-03-22 13:02:00 +00:00
Matthew Wild
c600e0f6f6 util.async: Add once() to create temporary runners 2018-03-22 07:56:01 +00:00
Matthew Wild
430eef8420 util.async: Add ready() to check whether running in async context 2018-03-22 07:46:23 +00:00
Matthew Wild
6191ad50b7 util.async: Bump log warnings to error level 2018-03-19 11:51:40 +00:00
Matthew Wild
8713a96ea6 util.async: Split runner_continue into smaller functions for easier testing and safety 2018-03-18 12:05:38 +00:00
Matthew Wild
a87f39878a util.async: Remove redundant line committed by mistake (Zash, luacheck) 2018-03-17 22:03:08 +00:00
Matthew Wild
f0d4a5254e util.async: ensure change in e77b37de482e applies after out-of-loop resume also 2018-03-17 17:28:07 +00:00
Matthew Wild
3148c6b4f7 util.async: Behaviour change: continue to process queued items after errors 2018-03-17 14:54:48 +00:00
Matthew Wild
18c5a6ca6b util.async: Convert asserts to a return false (same as other unexpected behaviour) 2018-03-17 11:46:21 +00:00
Matthew Wild
fe5a2515ac util.async: Add comment 2018-03-16 22:31:12 +00:00
Matthew Wild
04e125d52f util.async: You can never have too many asserts! 2018-03-16 22:30:25 +00:00
Matthew Wild
a4d4661846 util.async: Ensure runner is left in correct state after out-of-main-loop error (+tests) 2018-03-16 22:26:15 +00:00
Matthew Wild
63c7d4d8a3 util.async: Log the non-error state as well when there is an error being processed 2018-03-16 17:13:20 +00:00
Matthew Wild
09aa4a9698 util.async: Bugfix, don't continue main loop while there is a pending error 2018-03-16 17:12:36 +00:00
Matthew Wild
fd381c6b8d util.async: Fix order of statements so queue count makes more sense 2018-03-16 17:12:09 +00:00
Matthew Wild
6b147cfc39 util.async: Log warning when unexpected state is reached 2018-03-16 17:11:23 +00:00
Matthew Wild
46a9b42142 util.async: Add per-runner ids and add runner:log() method 2018-03-16 14:59:41 +00:00
Kim Alvefur
170cc278f9 util.async: Fix thread check to work correctly in Lua 5.2
coroutine.running() now returns the main thread and a boolean true if
called from the main thread, as opposed to nil in 5.1
2017-11-21 21:48:43 +01:00
Kim Alvefur
a031c5073b util.async: Factor out thread check into a function 2017-11-21 21:48:14 +01:00
Waqas Hussain
a408d9d946 util.async: Fix documentation URL 2017-09-15 17:17:07 -04:00
Kim Alvefur
bdaf30fb87 util.async: Add annotation to ignore warning [luacheck] 2016-11-19 01:11:28 +01:00
Kim Alvefur
cf352af83d util.async: Rename variable to avoid name clash [luacheck] 2016-11-19 01:11:53 +01:00
Matthew Wild
ed04424e61 util.async: Add some more comments for clarity 2016-05-22 20:06:12 +01:00
Emmanuel Gil Peyrot
bbf1653e04 Update every link to the documentation to use HTTPS 2016-04-16 21:08:05 +01:00
Matthew Wild
4b544bde27 util.async: Make guarder() local 2013-08-13 23:38:50 +01:00
Matthew Wild
754483ceb6 util.async: Add guarder method, to create guards to ensure only a single runner can pass through a section of code at a time 2013-08-13 21:26:53 +01:00
Matthew Wild
0881416b62 util.async: Fix logic bug that prevented error watcher being called for runners 2013-08-13 19:23:00 +01:00
Kim Alvefur
dc95267cdb util.async: waiter: Throw error if done() called too many times 2013-08-12 13:22:27 +02:00
Matthew Wild
86a6492eb0 util.async: waiter: Remove restriction about wait() being called before done() 2013-08-12 12:08:51 +01:00
Matthew Wild
7c85c2cd9c util.async: runner: Fix check for new state to recognise transition to 'waiting' 2013-08-12 11:50:27 +01:00
Matthew Wild
df81676c77 util.async: Make functions local 2013-08-12 10:27:08 +01:00
Matthew Wild
672089f4e3 util.async: New library to provide support around coroutine-based non-blocking functions 2013-08-11 14:46:07 +01:00