API C FunctionContainers.CreateCallback

Creates a function container that invokes a cancellable callback function.
 container = C_FunctionContainers.CreateCallback(func)
==Arguments==
:;func: - A Lua function to be called.
==Returns==
:;container:FunctionContainer - A container object bound to the supplied function.
==Details==
* The supplied callback must be a Lua function. The API will reject C functions and any non-function values.
==Example==
The following snippet creates a function container and schedules it to be executed every second, cancelling itself after five calls.
local container = C_FunctionContainers.CreateCallback(function()
 container.timesCalled = container.timesCalled + 1
 if container.timesCalled == 5 then
 container:Cancel()
 end
 print("Called!")
end)
container.timesCalled = 0
C_Timer.NewTicker(1, container)
==Patch changes==
*