public async Task <IResult> Invoke(IInvocation inv) { if (_destroyed) { throw new Exception("Rpc invoker for service " + this + " on consumer " + NetUtils.GetLocalAddress() + " use dubbo version " + Common.Version.GetVersion() + " is DESTROYED, can not be invoked any more!"); } RpcInvocation invocation = (RpcInvocation)inv; invocation.Invoker = this; if (_attachment != null && _attachment.Count > 0) { invocation.AddAttachmentsIfAbsent(_attachment); } //todo RpcContext //var context = RpcContext.getContext().getAttachments(); //if (context != null) //{ // invocation.AddAttachmentsIfAbsent(context); //} if (GetUrl().GetMethodParameter(invocation.MethodName, Constants.AsyncKey, false)) { invocation.SetAttachment(Constants.AsyncKey, "true"); } RpcUtils.AttachInvocationIdIfAsync(GetUrl(), invocation); //Console.WriteLine("step4:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")); try { return(await DoInvoke(invocation)); } catch (Exception e) { return(new RpcResult(e)); } }