Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | util: Prefix module imports with prosody namespace | Kim Alvefur | 2023-03-17 | 1 | -3/+3 |
| | |||||
* | util.async: Optionally allow too many 'done' callbacks | Kim Alvefur | 2022-02-22 | 1 | -2/+2 |
| | | | | | Sometimes, like in mod_c2s and mod_s2s during shutdown, all you want is to wait for the first done() and not complicate things. | ||||
* | util.async: Add next-tick configuration | Matthew Wild | 2021-11-29 | 1 | -2/+8 |
| | | | | | | | | Running woken runners in the next iteration of the event loop prevents unexpected recursion, unexpected tracebacks, and is generally more predictable. The pattern is borrowed from util.promise, where we're now doing the same. | ||||
* | util.async: Add sleep() method with configurable scheduling backend | Matthew Wild | 2021-11-29 | 1 | -0/+15 |
| | | | | | | | | | No scheduler set by default, so it will error (we plan to initialize it in util.startup). We wanted to avoid a hard dependency on util.timer (which in turn depends on network backends, etc.), and we didn't add timer.sleep() because we didn't want to add a hard dependency on util.async for things that don't need it. | ||||
* | util.async: Don't attempt to close thread if not created yet | Matthew Wild | 2020-06-14 | 1 | -1/+1 |
| | |||||
* | util.async: Call coroutine.close() on dead threads (Lua 5.4) | Matthew Wild | 2020-06-14 | 1 | -1/+5 |
| | |||||
* | util.async: Rename wait -> wait_for (w/compat) | Matthew Wild | 2020-06-13 | 1 | -2/+3 |
| | | | | Agreed this name is clearer and wait_for(thing) reads well in code. | ||||
* | util.async: Add function for waiting on promises and unpacking the results | Kim Alvefur | 2019-09-29 | 1 | -0/+16 |
| | |||||
* | Many things: switch from hacky multi-arg xpcall implementations to a ↵ | Matthew Wild | 2018-10-26 | 1 | -1/+2 |
| | | | | standard util.xpcall | ||||
* | util.async: Remove sleep function | Kim Alvefur | 2018-08-12 | 1 | -8/+0 |
| | | | | | Dependency on util.timer indirectly caused net.server to be initialized before the config was read, so server_select was always chosen. | ||||
* | util.{async,timer}: Move sleep() to reduce dependencies of util.timer | Kim Alvefur | 2018-07-08 | 1 | -0/+8 |
| | |||||
* | MUC: Add config option to allow members to invite other members to the room ↵ | Matthew Wild | 2018-07-06 | 1 | -2/+2 |
| | | | | (previously only owners/admins could do this) | ||||
* | util.async: Copy hooks from main thread into coroutines | Matthew Wild | 2018-06-25 | 1 | -0/+1 |
| | |||||
* | util.async: Move runner id into log tag | Kim Alvefur | 2018-05-04 | 1 | -3/+6 |
| | | | | Avoids string concatenation in every logger call | ||||
* | util.async: Add helper methods for setting watchers | Matthew Wild | 2018-04-30 | 1 | -0/+16 |
| | |||||
* | util.timer: Move sleep() here from util.async | Kim Alvefur | 2018-03-23 | 1 | -8/+0 |
| | | | | This is to solve a indirect dependency issue where net.server was initialized before the config was read | ||||
* | util.async: Remove last trace of async.once [luacheck] | Kim Alvefur | 2018-03-23 | 1 | -1/+0 |
| | |||||
* | util.async: Remove async.once(), can now be replaced by runner():run(func) | Matthew Wild | 2018-03-23 | 1 | -14/+0 |
| | |||||
* | util.async: Make parameters to async.runner() optional | Matthew Wild | 2018-03-23 | 1 | -3/+7 |
| | |||||
* | util.async: Use wrapper for once runner (thanks luacheck) | Kim Alvefur | 2018-03-22 | 1 | -1/+1 |
| | |||||
* | util.async: Allow nil as a guard key | Matthew Wild | 2018-03-22 | 1 | -0/+2 |
| | |||||
* | util.async: Add sleep() method | Matthew Wild | 2018-03-22 | 1 | -1/+9 |
| | |||||
* | util.async: Add once() to create temporary runners | Matthew Wild | 2018-03-22 | 1 | -1/+21 |
| | |||||
* | util.async: Add ready() to check whether running in async context | Matthew Wild | 2018-03-22 | 1 | -1/+5 |
| | |||||
* | util.async: Bump log warnings to error level | Matthew Wild | 2018-03-19 | 1 | -2/+2 |
| | |||||
* | util.async: Split runner_continue into smaller functions for easier testing ↵ | Matthew Wild | 2018-03-18 | 1 | -8/+29 |
| | | | | and safety | ||||
* | util.async: Remove redundant line committed by mistake (Zash, luacheck) | Matthew Wild | 2018-03-17 | 1 | -1/+0 |
| | |||||
* | util.async: ensure change in e77b37de482e applies after out-of-loop resume also | Matthew Wild | 2018-03-17 | 1 | -2/+1 |
| | |||||
* | util.async: Behaviour change: continue to process queued items after errors | Matthew Wild | 2018-03-17 | 1 | -0/+3 |
| | |||||
* | util.async: Convert asserts to a return false (same as other unexpected ↵ | Matthew Wild | 2018-03-17 | 1 | -2/+4 |
| | | | | behaviour) | ||||
* | util.async: Add comment | Matthew Wild | 2018-03-16 | 1 | -0/+1 |
| | |||||
* | util.async: You can never have too many asserts! | Matthew Wild | 2018-03-16 | 1 | -0/+2 |
| | |||||
* | util.async: Ensure runner is left in correct state after out-of-main-loop ↵ | Matthew Wild | 2018-03-16 | 1 | -1/+6 |
| | | | | error (+tests) | ||||
* | util.async: Log the non-error state as well when there is an error being ↵ | Matthew Wild | 2018-03-16 | 1 | -1/+1 |
| | | | | processed | ||||
* | util.async: Bugfix, don't continue main loop while there is a pending error | Matthew Wild | 2018-03-16 | 1 | -1/+1 |
| | |||||
* | util.async: Fix order of statements so queue count makes more sense | Matthew Wild | 2018-03-16 | 1 | -1/+2 |
| | |||||
* | util.async: Log warning when unexpected state is reached | Matthew Wild | 2018-03-16 | 1 | -0/+1 |
| | |||||
* | util.async: Add per-runner ids and add runner:log() method | Matthew Wild | 2018-03-16 | 1 | -1/+10 |
| | |||||
* | util.async: Fix thread check to work correctly in Lua 5.2 | Kim Alvefur | 2017-11-21 | 1 | -2/+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 | ||||
* | util.async: Factor out thread check into a function | Kim Alvefur | 2017-11-21 | 1 | -8/+10 |
| | |||||
* | util.async: Fix documentation URL | Waqas Hussain | 2017-09-15 | 1 | -2/+2 |
| | |||||
* | util.async: Add annotation to ignore warning [luacheck] | Kim Alvefur | 2016-11-19 | 1 | -1/+1 |
| | |||||
* | util.async: Rename variable to avoid name clash [luacheck] | Kim Alvefur | 2016-11-19 | 1 | -2/+2 |
| | |||||
* | util.async: Add some more comments for clarity | Matthew Wild | 2016-05-22 | 1 | -0/+15 |
| | |||||
* | Update every link to the documentation to use HTTPS | Emmanuel Gil Peyrot | 2016-04-16 | 1 | -2/+2 |
| | |||||
* | util.async: Make guarder() local | Matthew Wild | 2013-08-13 | 1 | -1/+1 |
| | |||||
* | util.async: Add guarder method, to create guards to ensure only a single ↵ | Matthew Wild | 2013-08-13 | 1 | -1/+37 |
| | | | | runner can pass through a section of code at a time | ||||
* | util.async: Fix logic bug that prevented error watcher being called for runners | Matthew Wild | 2013-08-13 | 1 | -2/+6 |
| | |||||
* | util.async: waiter: Throw error if done() called too many times | Kim Alvefur | 2013-08-12 | 1 | -0/+2 |
| | |||||
* | util.async: waiter: Remove restriction about wait() being called before done() | Matthew Wild | 2013-08-12 | 1 | -4/+5 |
| |