.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Search::Elasticsearch::Role::CxnPool 3pm" .TH Search::Elasticsearch::Role::CxnPool 3pm 2024-02-04 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Search::Elasticsearch::Role::CxnPool \- Provides common functionality to the CxnPool implementations .SH VERSION .IX Header "VERSION" version 8.12 .SH DESCRIPTION .IX Header "DESCRIPTION" See the CxnPool implementations: .IP \(bu 4 Search::Elasticsearch::CxnPool::Static .IP \(bu 4 Search::Elasticsearch::CxnPool::Sniff .IP \(bu 4 Search::Elasticsearch::CxnPool::Static::NoPing .SH CONFIGURATION .IX Header "CONFIGURATION" These configuration options should not be set by the user but are documented here for completeness. .ie n .SS """randomize_cxns""" .el .SS \f(CWrandomize_cxns\fP .IX Subsection "randomize_cxns" By default, the order of cxns passed to "\fBset_cxns()\fR" is randomized before they are stored. Set \f(CW\*(C`randomize_cxns\*(C'\fR to a false value to disable. .SH METHODS .IX Header "METHODS" .ie n .SS cxn_factory() .el .SS \f(CWcxn_factory()\fP .IX Subsection "cxn_factory()" .Vb 1 \& $factory = $cxn_pool\->cxn_factory .Ve .PP Returns the Search::Elasticsearch::Cxn::Factory object for creating a new \&\f(CW$cxn\fR instance. .ie n .SS logger() .el .SS \f(CWlogger()\fP .IX Subsection "logger()" .Vb 1 \& $logger = $cxn_pool\->logger .Ve .PP Returns the Search::Elasticsearch::Role::Logger\-based object, which defaults to Search::Elasticsearch::Logger::LogAny. .ie n .SS serializer() .el .SS \f(CWserializer()\fP .IX Subsection "serializer()" .Vb 1 \& $serializer = $cxn_pool\->serializer .Ve .PP Returns the Search::Elasticsearch::Role::Serializer\-based object, which defaults to Search::Elasticsearch::Serializer::JSON. .ie n .SS current_cxn_num() .el .SS \f(CWcurrent_cxn_num()\fP .IX Subsection "current_cxn_num()" .Vb 1 \& $num = $cxn_pool\->current_cxn_num .Ve .PP Returns the current cxn number, which is an offset into the array of cxns set by "\fBset_cxns()\fR". .ie n .SS cxns() .el .SS \f(CWcxns()\fP .IX Subsection "cxns()" .Vb 1 \& \e@cxns = $cxn_pool\->cxns; .Ve .PP Returns the current list of Search::Elasticsearch::Role::Cxn\-based cxn objects as set by "\fBset_cxns()\fR". .ie n .SS seed_nodes() .el .SS \f(CWseed_nodes()\fP .IX Subsection "seed_nodes()" .Vb 1 \& \e@seed_nodes = $cxn_pool\->seed_nodes .Ve .PP Returns the list of \f(CW\*(C`nodes\*(C'\fR originally specified when calling "\fBnew()\fR" in Search::Elasticsearch. .ie n .SS next_cxn_num() .el .SS \f(CWnext_cxn_num()\fP .IX Subsection "next_cxn_num()" .Vb 1 \& $num = $cxn_pool\->next_cxn_num; .Ve .PP Returns the number of the next connection, in round-robin fashion. Updates the "\fBcurrent_cxn_num()\fR". .ie n .SS set_cxns() .el .SS \f(CWset_cxns()\fP .IX Subsection "set_cxns()" .Vb 1 \& $cxn_pool\->set_cxns(@nodes); .Ve .PP Takes a list of nodes, converts them into Search::Elasticsearch::Role::Cxn\-based objects and makes them accessible via "\fBcxns()\fR". .ie n .SS request_ok() .el .SS \f(CWrequest_ok()\fP .IX Subsection "request_ok()" .Vb 1 \& $cxn_pool\->request_ok($cxn); .Ve .PP Called when a request by the specified \f(CW$cxn\fR object has completed successfully. Marks the \f(CW$cxn\fR as live. .ie n .SS request_failed() .el .SS \f(CWrequest_failed()\fP .IX Subsection "request_failed()" .Vb 1 \& $should_retry = $cxn_pool\->request_failed($cxn,$error); .Ve .PP Called when a request by the specified \f(CW$cxn\fR object has failed. Returns \&\f(CW1\fR if the request should be retried or \f(CW0\fR if it shouldn't. .ie n .SS should_retry() .el .SS \f(CWshould_retry()\fP .IX Subsection "should_retry()" .Vb 1 \& $bool = $cxn_pool\->should_retry($error); .Ve .PP Examines the error to decide whether the request should be retried or not. By default, only "Search::Elasticsearch::Error::Cxn" in Search::Elasticsearch::Error errors are retried. .ie n .SS should_mark_dead() .el .SS \f(CWshould_mark_dead()\fP .IX Subsection "should_mark_dead()" .Vb 1 \& $bool = $cxn_pool\->should_mark_dead($error); .Ve .PP Examines the error to decide whether the \f(CW$cxn\fR should be marked as dead or not. By default, only "Search::Elasticsearch::Error::Cxn" in Search::Elasticsearch::Error errors cause a \f(CW$cxn\fR to be marked as dead. .ie n .SS cxns_str() .el .SS \f(CWcxns_str()\fP .IX Subsection "cxns_str()" .Vb 1 \& $str = $cxn_pool\->cxns_str .Ve .PP Returns all "\fBcxns()\fR" as a string for logging purposes. .ie n .SS cxns_seeds_str() .el .SS \f(CWcxns_seeds_str()\fP .IX Subsection "cxns_seeds_str()" .Vb 1 \& $str = $cxn_pool\->cxns_seeeds_str .Ve .PP Returns all "\fBcxns()\fR" and "\fBseed_nodes()\fR" as a string for logging purposes. .ie n .SS retries() .el .SS \f(CWretries()\fP .IX Subsection "retries()" .Vb 1 \& $retries = $cxn_pool\->retries .Ve .PP The number of times the current request has been retried. .ie n .SS reset_retries() .el .SS \f(CWreset_retries()\fP .IX Subsection "reset_retries()" .Vb 1 \& $cxn_pool\->reset_retries; .Ve .PP Called at the start of a new request to reset the retries count. .SH AUTHOR .IX Header "AUTHOR" Enrico Zimuel .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2024 by Elasticsearch BV. .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve