public HerculesTimelineClient([NotNull] HerculesTimelineClientSettings <T> settings, [CanBeNull] ILog log)
        {
            this.log = log = (log ?? LogProvider.Get()).ForContext <HerculesTimelineClient>();

            bufferPool = new BufferPool(settings.MaxPooledBufferSize, settings.MaxPooledBuffersPerBucket);

            client = ClusterClientFactory.Create(
                settings.Cluster,
                log,
                Constants.ServiceNames.TimelineApi,
                config =>
            {
                config.SetupUniversalTransport(
                    new UniversalTransportSettings
                {
                    BufferFactory = bufferPool.Rent
                });
                config.AddRequestTransform(new ApiKeyRequestTransform(settings.ApiKeyProvider));
                settings.AdditionalSetup?.Invoke(config);
            });

            responseAnalyzer     = new ResponseAnalyzer(ResponseAnalysisContext.Timeline);
            eventBuilderProvider = settings.EventBuilderProvider;
        }
예제 #2
0
 public HerculesTimelineClient([NotNull] HerculesTimelineClientSettings settings, [CanBeNull] ILog log) =>