Change Log:
--------------------
version 1.8.0:
- API update "Murkmire".
- Adjustment to scheduler calculation: Reduce allowed-time after a burst even if loops still running.
- Change from GetGameTimeMilliseconds to GetGameTimeSeconds, which has in fact more precision. Thanks to @zsban.
Description:
--------------------
Description
Read this article of the Wiki.
API
local async = LibStub("LibAsync")
local task = async:Create(name)
The signature of FuncOfTask is:
local function(task)
end
-- Get the current context, if you are within a FuncOfTask or nil.
function async:GetCurrent()
-- Create an interruptible task context.
function async:Create(name)
-- Resume the execution context.
task:Resume()
-- Suspend the execution context and allow to resume anytime later.
function task:Suspend()
-- Interupt and fully stop the execution context. Can be called from outside to stop everything.
function task:Cancel()
-- Run the given FuncOfTask in your task context execution.
function task:Call(funcOfTask)
-- Continue your task context execution with the given FuncOfTask after the previous as finished.
function task:Then(funcOfTask)
-- Start an interruptible for-loop.
function task:For(from, to, step)
function task:For(pairs(tbl))
function task:For(ipairs(tbl))
-- Execute the async-for with the given step-function. The parameters of the step-function are those you would use in your for body.
function task:Do(func)
The signature if func is function(index) or function(key, value)
If you return async.BREAK within func, it will break the loop.
-- Suspend the execution of your task context for the given delay in milliseconds and then call the given FuncOfTask to continue.
function task:Delay(delay, funcOfTask)
-- Stop the delay created by Delay
function task:StopTimer()
-- Set a FuncOfTask as a final handler. Called even if something went wrong in your context.
function task:Fina...
--------------------
version 1.8.0:
- API update "Murkmire".
- Adjustment to scheduler calculation: Reduce allowed-time after a burst even if loops still running.
- Change from GetGameTimeMilliseconds to GetGameTimeSeconds, which has in fact more precision. Thanks to @zsban.
Description:
--------------------
Description
Read this article of the Wiki.
API
local async = LibStub("LibAsync")
local task = async:Create(name)
The signature of FuncOfTask is:
local function(task)
end
-- Get the current context, if you are within a FuncOfTask or nil.
function async:GetCurrent()
-- Create an interruptible task context.
function async:Create(name)
-- Resume the execution context.
task:Resume()
-- Suspend the execution context and allow to resume anytime later.
function task:Suspend()
-- Interupt and fully stop the execution context. Can be called from outside to stop everything.
function task:Cancel()
-- Run the given FuncOfTask in your task context execution.
function task:Call(funcOfTask)
-- Continue your task context execution with the given FuncOfTask after the previous as finished.
function task:Then(funcOfTask)
-- Start an interruptible for-loop.
function task:For(from, to, step)
function task:For(pairs(tbl))
function task:For(ipairs(tbl))
-- Execute the async-for with the given step-function. The parameters of the step-function are those you would use in your for body.
function task:Do(func)
The signature if func is function(index) or function(key, value)
If you return async.BREAK within func, it will break the loop.
-- Suspend the execution of your task context for the given delay in milliseconds and then call the given FuncOfTask to continue.
function task:Delay(delay, funcOfTask)
-- Stop the delay created by Delay
function task:StopTimer()
-- Set a FuncOfTask as a final handler. Called even if something went wrong in your context.
function task:Fina...