Пример #1
0
        public void RpcCall(string rpcName, params object[] args)
        {
            RpcEventMsg eventMsg = new RpcEventMsg();

            if (tlsCtx.IsValueCreated == true)
            {
                eventMsg.sAgent = tlsCtx.Value.m;
            }
            eventMsg.attachData = args;
            eventMsg.rpcName    = rpcName;
            this.Enqueue(eventMsg);
        }
Пример #2
0
        private void HandlerRouteRpc(EventMsg eventMsg)
        {
            RpcEventMsg rpcMsg = (RpcEventMsg)eventMsg;

            RpcHandler handler = null;

            if (rpcHandlerMap.TryGetValue(rpcMsg.rpcName, out handler))
            {
                workerContext.s = rpcMsg.sAgent;
                handler(workerContext, rpcMsg.attachData);
            }
            else
            {
                sLog.Error("executor", "executor {0} handle route rpc type {1} null.", this.mName, rpcMsg.rpcName);
            }
        }