예제 #1
0
 public ClientTracerApiProxySmartWrapper(IClientTracerApiProxy apiProxy)
 {
     Proxy      = apiProxy;
     GetDateNow = DateHelper.Instance.GetDateNow;
     //todo config
     CheckSmart = CheckIfNotOkAndExpired.Create(TimeSpan.FromSeconds(3));
 }
예제 #2
0
        private static void ResetForWrapper(IClientTracerApiProxy apiProxy, TimeSpan?checkApiStatusInterval, Func <DateTime> getDateNow)
        {
            var clientTracerApiProxySmartWrapper = ApiProxyContext.Current as ClientTracerApiProxySmartWrapper;

            if (clientTracerApiProxySmartWrapper == null)
            {
                throw new InvalidOperationException("this reset method is for ClientTracerApiProxySmartWrapper instance, but Current is not instance of it!");
            }

            clientTracerApiProxySmartWrapper.Reset(apiProxy, checkApiStatusInterval, getDateNow);
        }
        public void Reset(IClientTracerApiProxy apiProxy, TimeSpan?checkApiStatusInterval = null, Func <DateTime> getDateNow = null)
        {
            Proxy = apiProxy ?? throw new ArgumentNullException(nameof(apiProxy));

            if (checkApiStatusInterval != null)
            {
                CheckSmart = CheckIfNotOkAndExpired.Create(checkApiStatusInterval);
            }
            if (getDateNow != null)
            {
                GetDateNow = getDateNow;
            }
        }
예제 #4
0
 public CallApiFormCtrl(ClientSpanRepos clientSpanRepository, IClientTracerApiProxy apiProxy)
 {
     _clientSpanRepository = clientSpanRepository;
     _apiProxy             = apiProxy;
 }