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