Exemplo n.º 1
0
 public WebRequestServices(TrueShipConfiguration config, ThrottlerAsync throttler)
 {
     Condition.Requires(config, "config").IsNotNull();
     this._config    = config;
     this._throttler = throttler;
     JsonCustomSerializationOptionsProvider.Setup();
 }
Exemplo n.º 2
0
 public virtual void Init()
 {
     _callCounter = 0;
     _callCounterFunc = () => _callCounter++;
     if (IsAsyncVersion)
     {
         ThrottlerAsync = GetThrottlerFuncAsync();
         _throttlerExecute = x => ThrottlerAsync.ExecuteAsync(() => Task.FromResult(x())).GetAwaiter().GetResult();
     }
     else
     {
         Throttler = GetThrottlerFunc();
         _throttlerExecute = x => Throttler.Execute(x);
     }
 }