예제 #1
0
        public ETTask <IResponse> CallWithoutException(IRequest request)
        {
            int rpcId = ++RpcId;
            var tcs   = new ETTaskCompletionSource <IResponse>();

            this.requestCallback[rpcId] = (response) =>
            {
                if (response is ErrorResponse)
                {
                    tcs.SetException(new Exception($"Rpc error: {MongoHelper.ToJson(response)}"));
                    return;
                }

                tcs.SetResult(response);
            };

            request.RpcId = rpcId;
            this.Send(request);
            return(tcs.Task);
        }
예제 #2
0
파일: Log.cs 프로젝트: LJM74520/nice
 public static void Msg(object message)
 {
     globalLog.Debug(MongoHelper.ToJson(message));
 }
예제 #3
0
파일: JsonHelper.cs 프로젝트: LJM74520/nice
 public static string ToJson(object obj)
 {
     return(MongoHelper.ToJson(obj));
 }
예제 #4
0
 public static string MessageToStr(object message)
 {
     return(MongoHelper.ToJson(message));
 }
예제 #5
0
파일: Entity.cs 프로젝트: LJM74520/nice
 public override string ToString()
 {
     return(MongoHelper.ToJson(this));
 }