Beispiel #1
0
        public FixedPipelineFactory(IConnectionSettingsValues connectionSettings, IDateTimeProvider dateTimeProvider)
        {
            this.DateTimeProvider    = dateTimeProvider;
            this.MemoryStreamFactory = new MemoryStreamFactory();

            this.Settings = connectionSettings;
            this.Pipeline = this.Create(this.Settings, this.DateTimeProvider, this.MemoryStreamFactory, new SearchRequestParameters());
        }
		private static void HandlePipelineException<TResponse>(
			ref TResponse response, PipelineException ex, IRequestPipeline pipeline, Node node, List<PipelineException> seenExceptions)
			where TResponse : class, IElasticsearchResponse, new()
		{
			if (response == null) response = ex.Response as TResponse;
			pipeline.MarkDead(node);
			seenExceptions.Add(ex);
		}
		public FixedPipelineFactory(IConnectionSettingsValues connectionSettings, IDateTimeProvider dateTimeProvider)
		{
			this.DateTimeProvider = dateTimeProvider;
			this.MemoryStreamFactory = new MemoryStreamFactory();

			this.Settings = connectionSettings;
			this.Pipeline = this.Create(this.Settings, this.DateTimeProvider, this.MemoryStreamFactory, new SearchRequestParameters());
		}
 private static void Ping(IRequestPipeline pipeline, Node node)
 {
     try
     {
         pipeline.Ping(node);
     }
     catch (PipelineException e) when(e.Recoverable)
     {
         pipeline.SniffOnConnectionFailure();
         throw;
     }
 }
Beispiel #5
0
 private static void Ping(IRequestPipeline pipeline, Node node, List <PipelineException> seenExceptions)
 {
     try
     {
         pipeline.Ping(node);
     }
     catch (PipelineException e) when(e.Recoverable)
     {
         pipeline.SniffOnConnectionFailure();
         e.RethrowKeepingStackTrace();
     }
 }
Beispiel #6
0
		private static async Task PingAsync(IRequestPipeline pipeline, Node node, CancellationToken cancellationToken)
		{
			try
			{
				await pipeline.PingAsync(node, cancellationToken).ConfigureAwait(false);
			}
			catch (PipelineException e) when (e.Recoverable)
			{
				await pipeline.SniffOnConnectionFailureAsync(cancellationToken).ConfigureAwait(false);
				throw;
			}
		}
 private static void HandlePipelineException <TResponse>(
     ref TResponse response, PipelineException ex, IRequestPipeline pipeline, Node node, ICollection <PipelineException> seenExceptions
     )
     where TResponse : class, ITransportResponse, new()
 {
     if (response == null)
     {
         response = ex.Response as TResponse;
     }
     pipeline.MarkDead(node);
     seenExceptions.Add(ex);
 }
Beispiel #8
0
        private static async Task PingAsync(IRequestPipeline pipeline, Node node, List <PipelineException> seenExceptions)
        {
            try
            {
                await pipeline.PingAsync(node);
            }
            catch (PipelineException e) when(e.Recoverable)
            {
                await pipeline.SniffOnConnectionFailureAsync();

                e.RethrowKeepingStackTrace();
            }
        }
		private TResponse FinalizeResponse<TResponse>(RequestData requestData, IRequestPipeline pipeline, List<PipelineException> seenExceptions,
			TResponse response) where TResponse : class, IElasticsearchResponse, new()
		{
			if (requestData.Node == null) //foreach never ran
				pipeline.ThrowNoNodesAttempted(requestData, seenExceptions);

			var callDetails = GetMostRecentCallDetails(response, seenExceptions);
			var clientException = pipeline.CreateClientException(response, callDetails, requestData, seenExceptions);

			if (response?.ApiCall == null)
				pipeline.BadResponse(ref response, callDetails, requestData, clientException);

			HandleElasticsearchClientException(requestData, clientException, response);
			return response;
		}
 private async Task PingAsync(IRequestPipeline pipeline, Node node, CancellationToken cancellationToken)
 {
     try
     {
         await pipeline.PingAsync(node, cancellationToken).ConfigureAwait(false);
     }
     catch (PipelineException e) when(e.Recoverable)
     {
         if (_productRegistration.SupportsSniff)
         {
             await pipeline.SniffOnConnectionFailureAsync(cancellationToken).ConfigureAwait(false);
         }
         throw;
     }
 }
 private void Ping(IRequestPipeline pipeline, Node node)
 {
     try
     {
         pipeline.Ping(node);
     }
     catch (PipelineException e) when(e.Recoverable)
     {
         if (_productRegistration.SupportsSniff)
         {
             pipeline.SniffOnConnectionFailure();
         }
         throw;
     }
 }
Beispiel #12
0
 public HtmlRenderer() 
 {
     requestPipeline = DefaultRequestPipeline.Instance;
     preloader = new ConcurrentPreloaderService();
     rewriter = DefaultContentRewriterRegistry.Instance;
 }
Beispiel #13
0
 public Mediator(IRequestPipeline requestPipeline = null)
 {
     this.requestPipeline = requestPipeline ?? new RequestPipeline();
 }
Beispiel #14
0
 public HtmlRenderer()
 {
     requestPipeline = DefaultRequestPipeline.Instance;
     preloader       = new ConcurrentPreloaderService();
     rewriter        = DefaultContentRewriterRegistry.Instance;
 }
Beispiel #15
0
 public TrelloCoordinator(IRequestPipeline pipelineFactory)
 {
     _pipelineFactory = pipelineFactory;
 }
Beispiel #16
0
 public static IRequestPipeline <TContext> Use <TContext>(this IRequestPipeline <TContext> builder, Func <TContext, Func <ValueTask>, ValueTask> func)
 {
     return(builder.Use(next => context => func(context, () => next(context))));
 }
Beispiel #17
0
 protected MakeRequestHandler()
 {
     contentRewriterRegistry = DefaultContentRewriterRegistry.Instance;
     this.requestPipeline = DefaultRequestPipeline.Instance;
 }
Beispiel #18
0
 protected MakeRequestHandler()
 {
     contentRewriterRegistry = DefaultContentRewriterRegistry.Instance;
     this.requestPipeline    = DefaultRequestPipeline.Instance;
 }