Transformer Pipeline Module API Reference  6.2.11.309924
Timer management

Functions

 timer.add (var ttab)
 Add a new timer to the system. More...
 
 timer.del (var identifier)
 Remove a timer from the system,. More...
 

Detailed Description

The functions in this package provider timer management for pipeline scripts.

Timers are one-shot events that can only be set in the future, i.e. if an attempt is made to make the timer fire in the past, then the call to timer.add will fail.

Function Documentation

timer.add ( var  ttab)

Add a new timer to the system.

Parameters
ttab- Table
Returns
A timer handle
Return values
nil- Inappropriate timestamp

The time may either be an offset from the current time in seconds or a fully qualified timestamp in the form: %Y-%m-%dT%H:%M:%SZ If the time obtained from the timestamp has passed, then nil will be returned and the timer won't be set.

The handle returned should be regarded as opaque and not inspected.

Note
When the event occurs, the timer is automatically removed from the system, that is to say, timers do not repeat.

The following example adds a timer to fire in 15 seconds

require("timer")
function callback(callback_table)
end
function start_timer()
-- Define the timer definition
local callback_table = {}
callback_table.callback = "callback"
callback_table.time = 15.0
timer.add(callback_table)
end
timer.del ( var  identifier)

Remove a timer from the system,.

Parameters
identifier- Timer identifier
Returns
Nothing

The handle supplied to that function, is the same as that returned by timer.add()


Generated on Sat Aug 26 2017 12:36:33 for Transformer Pipeline Module API Reference