You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lua/README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,9 @@ The first thing to do when writing a lua script for MQ2 is to `require('mq')`. T
86
86
`mq.delay(val, --[[optional]]callback)`
87
87
: 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.
88
88
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
+
89
92
`mq.join(args...)`
90
93
: where args must be convertible to string inside lua. This will join all the arguments into a single string
0 commit comments