Members
(static) ExecutionQueue.fake_push
Set this to a callback function to be called instead of the normal push function, so that you can test the value that will be pushed to the queue during automated testing
- Source:
Example
ExecutionQueue.fake_push = function(function_name,params,signature,dateobj)
{
if(dateobj.toLocaleString() != expected)
throw new Error("Wrong datetime pushed");
}
Methods
(static) ExecutionQueue.clear(signature)
Clear the rows from the ExecutionQueue with signature column starting with or matching given string
Parameters:
Name | Type | Description |
---|---|---|
signature |
string | total or partial matching signature string |
- Source:
Example
function doSomething(notification,signature)
{
var my_sig = new Notification(notification).card().id()+signature;
//clear any other executions for this card, related
//to the function called either globally, as part of
//a group or on a specific board
ExecutionQueue.clear(my_sig);
ExecutionQueue.push("doSomethingElse",
notification,
my_sig,
Trellinator.now().addDays(3).at("13:00"));
}
(static) ExecutionQueue.nextMinute()
Force the queue to run again in 1 minute
- Source:
(static) ExecutionQueue.push(function_name, params, signature, dateobj)
Push a new function to the execution queue
Parameters:
Name | Type | Description |
---|---|---|
function_name |
string | the name of the function to be called. Must be a function defined in the local scope of the Google Apps Script project, can't be from a library or a class member |
params |
Object | whatever argument will be passed into the function |
signature |
string | An arbitrary string that can be used to identify execution rows as being related. Typically you Every function call is passed a signature so you can use that verbatim or add to it. When you clear the queue you can use all or part of the signature |
dateobj |
Date | the date/time when the function should be executed. By default the queue is executed every 10 minutes, and any row with a function scheduled in the past or at precisely the current time is executed, and the originally date/time is passed into the function regardless of when it actually executes |
- Source:
Example
function doSomething(notification,signature)
{
ExecutionQueue.push("doSomethingElse",
notification,
signature,
Trellinator.now().addDays(3).at("9:00"));
}