Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Jira Legacy
serverSystem Jira
serverId4917c5d3-f7c1-348a-87e1-71271a4d06b7
keyIX-3497

Make a remote call - ie. call a function within another component

component.call{}

  • The interface is table in, anything out. Only the first returned argument is captured, so to return multiple values a table must be used.

  • the target component must be running

    Code Block
    -- this function is in the target component
    function doSomething(T) 
      return T.token .. " world", 1, {foo="bar"}
    end
    
    -- this function is in the caller component
    function makeRemoteCall()
      local CallData = {}
      CallData["token"] = "hello"
      local R, _num, _T  = component.call{id=”guid”, data=CallData, func=”doSomething”}
      trace(R)    -- "hello world"
      trace(_num) -- 1
      trace(_T)   -- {"foo":"bar"}
    end