invoke method

  1. @override
Future invoke(
  1. dynamic proxy,
  2. Introspector method,
  3. List args,
  4. Context? ctx,
)
override

Call will execute the method

Implementation

@override
Future<dynamic> invoke(dynamic proxy, Introspector method, List<dynamic> args,
    Context? ctx) async {
  return await Mesh.safe(ctx, (ctx) {
    var execution = eden.refer(mpi, reference, method, ctx);
    if (null == execution) {
      throw Status.noService.err(r: method.toString());
    }
    var urn = rewriteURN(execution, ctx);
    ctx.rewriteURN(urn);
    ctx.setAttribute(addressKey, rewriteAddress(ctx, urn));

    var parameters = method.inflect();
    parameters.arguments = args;
    parameters.attachments = {};

    var invocation = ServiceInvocation(this, method, parameters, args, {},
        Uint8List(0), execution, URN.from(urn));
    return invoker.run(ctx, invocation);
  });
}