Beispiel #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);
        }
Beispiel #2
0
 public static void Msg(object message)
 {
     globalLog.Debug(MongoHelper.ToJson(message));
 }
Beispiel #3
0
 public static string ToJson(object obj)
 {
     return(MongoHelper.ToJson(obj));
 }
Beispiel #4
0
 public static string MessageToStr(object message)
 {
     return(MongoHelper.ToJson(message));
 }
Beispiel #5
0
 public override string ToString()
 {
     return(MongoHelper.ToJson(this));
 }