Skip to content

Commit d3a692d

Browse files
committed
Add mq.canDelay()
1 parent 9f8f46e commit d3a692d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lua/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ The first thing to do when writing a lua script for MQ2 is to `require('mq')`. T
8686
`mq.delay(val, --[[optional]]callback)`
8787
: where val can be an integer (which denotes milliseconds of delay) or a string that ends in 's' 'm' or 'ms' to have delays with human readable durations. The callback is optinal and is a function which evaluates to true or false to decide whether to end the delay early.
8888

89+
`mq.canDelay()`
90+
: returns `true` if the current context allows yielding (i.e. `mq.delay` would be able to sleep), or `false` if it would error. The most common reason it returns `false` is that the caller is running at the top level of a module being loaded via `require`, where yielding is disabled.
91+
8992
`mq.join(args...)`
9093
: where args must be convertible to string inside lua. This will join all the arguments into a single string
9194

0 commit comments

Comments
 (0)