callCommand method

Future callCommand(
  1. String cmd,
  2. IContext? context,
  3. dynamic params
)

Calls a remote action in Azure Function. The name of the action is added as "cmd" parameter to the action parameters.

  • cmd an action name
  • context (optional) a context to trace execution through call chain.
  • params command parameters. Return Future that receives result Throws error.

Implementation

Future callCommand(String cmd, IContext? context, params) async {
  var timing = instrument(context, '$_name.$cmd');
  try {
    final result = await call(cmd, context, params);
    timing.endTiming();
    return result;
  } catch (ex) {
    timing.endFailure(ex as Exception);
    return ex;
  }
}