registerAsyncServerFunc(name, func, override = false) {
	        const asyncVariant = (...args) => {
	            const fargs = args.slice(0, args.length - 1);
	            // need to keep it alive until callback is fulfilled.
	            const callback = this.detachFromCurrentScope(args[args.length - 1]);
	            const promise = func(...fargs);
	            promise.then((rv) => {
	                callback(this.scalar(4 /* kReturn */, "int32"), rv);
	                callback.dispose();
	            });
	        };
	        this.registerFunc("__async." + name, asyncVariant, override);
	    }
Register an asyncfunction to be global function in the server.
@param name The name of the function.
@param func function to be registered.
@param override Whether overwrite function in existing registry.

@note The async function will only be used for serving remote calls in the rpc.