makeRPCResponsePackage method

DataPackage makeRPCResponsePackage(
  1. RemoteFunctionRunnableResult<T> result,
  2. DataPackage rpcRequest
)

Implementation

DataPackage makeRPCResponsePackage(
    RemoteFunctionRunnableResult<T> result, DataPackage rpcRequest) {

  DataPackage responsePackage = prepareResponsePackage(result.getStatus(), rpcRequest);

  T? returnValue = result.getReturnValue();
  if(returnValue != null)
  {
    print("Return type " + this._returnType.runtimeType.toString());
      Mutator<T> mutator = TypeMapping().getMutator(this._returnType);
      mutator.setter(responsePackage, returnValue);
  }

  return responsePackage;
}