run

:run( functionName, functionParameters, callback )

Calls a Coronium Cloud Code file and returns the results.

Parameters

Name Details
functionName The Cloud Code function name (String, required)
functionParameters Table of parameters in name/value pairs to pass to the function. Pass an empty table for no parameters. (Table, required)
callback The callback function. If not provided the global callback will be used. (Function, optional)

Returns

The Cloud Code results, if any.

Examples

local function onRun( event )
  if not event.error then
    print( event.result.value )
  end
end

coronium:run( "hello", { username = "Chris" }, onRun )