1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00
OpenMW/files/lua_api/openmw/async.lua

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.6 KiB
Lua
Raw Normal View History

2022-02-23 21:08:50 +00:00
---
2021-04-02 17:42:19 +00:00
-- `openmw.async` contains timers and coroutine utils. All functions require
-- the package itself as a first argument.
-- @module async
-- @usage local async = require('openmw.async')
2022-02-23 21:08:50 +00:00
---
2021-04-02 17:42:19 +00:00
-- Register a function as a timer callback.
-- @function [parent=#async] registerTimerCallback
-- @param self
-- @param #string name
-- @param #function func
-- @return #TimerCallback
2022-02-23 21:08:50 +00:00
---
-- Calls callback(arg) in `delay` simulation seconds.
2021-04-02 17:42:19 +00:00
-- Callback must be registered in advance.
-- @function [parent=#async] newSimulationTimer
2021-04-02 17:42:19 +00:00
-- @param self
-- @param #number delay
-- @param #TimerCallback callback A callback returned by `registerTimerCallback`
-- @param arg An argument for `callback`; can be `nil`.
2022-02-23 21:08:50 +00:00
---
-- Calls callback(arg) in `delay` game seconds.
2021-04-02 17:42:19 +00:00
-- Callback must be registered in advance.
-- @function [parent=#async] newGameTimer
2021-04-02 17:42:19 +00:00
-- @param self
-- @param #number delay
-- @param #TimerCallback callback A callback returned by `registerTimerCallback`
-- @param arg An argument for `callback`; can be `nil`.
2022-02-23 21:08:50 +00:00
---
-- Calls `func()` in `delay` simulation seconds.
2021-04-02 17:42:19 +00:00
-- The timer will be lost if the game is saved and loaded.
-- @function [parent=#async] newUnsavableSimulationTimer
2021-04-02 17:42:19 +00:00
-- @param self
-- @param #number delay
-- @param #function func
2022-02-23 21:08:50 +00:00
---
-- Calls `func()` in `delay` game seconds.
2021-04-02 17:42:19 +00:00
-- The timer will be lost if the game is saved and loaded.
-- @function [parent=#async] newUnsavableGameTimer
2021-04-02 17:42:19 +00:00
-- @param self
-- @param #number delay
-- @param #function func
2022-02-23 21:08:50 +00:00
---
2021-08-27 07:26:38 +00:00
-- Wraps Lua function with `Callback` object that can be used in async API calls.
-- @function [parent=#async] callback
-- @param self
-- @param #function func
-- @return #Callback
2021-04-02 17:42:19 +00:00
return nil