Search...xnPool(3pm)
π NAME π
Search::Elasticsearch::Role::CxnPool β okay so this is the role that hands out all the shared β¨functionalityβ¨ to the CxnPool implementations. It's a Perl module, bestie, so it lives in the User Contributed Perl Documentation corner of the manual, dated 2024-02-04, chilling on perl v5.38.2. π¦
π VERSION π
version 8.12 β slay, we're on the current one.
π DESCRIPTION π
Not me making you go read the actual CxnPool implementations, because this one is just the shared-role mothership. Go peek at these three:
Search::Elasticsearch::CxnPool::StaticSearch::Elasticsearch::CxnPool::SniffSearch::Elasticsearch::CxnPool::Static::NoPing
π CONFIGURATION π
Real talk: these configuration options are not for you to set. Like, the docs literally say they should not be set by the user. They're only written down here for completeness, so you know they exist. Hands off, bestie. π
randomize_cxns
By default, the order of cxns passed to set_cxns() is randomized before they are stored. If you want that to stop, set randomize_cxns to a false value and it's disabled. That's it, that's the whole vibe check.
π METHODS π
cxn_factory()
$factory = $cxn_pool->cxn_factory
Returns the Search::Elasticsearch::Cxn::Factory object for creating a new $cxn instance. Iconic little factory behaviour. π
logger()
$logger = $cxn_pool->logger
Returns the Search::Elasticsearch::Role::Logger-based object, which defaults to Search::Elasticsearch::Logger::LogAny.
serializer()
$serializer = $cxn_pool->serializer
Returns the Search::Elasticsearch::Role::Serializer-based object, which defaults to Search::Elasticsearch::Serializer::JSON.
current_cxn_num()
$num = $cxn_pool->current_cxn_num
Returns the current cxn number, which is an offset into the array of cxns set by set_cxns().
cxns()
\@cxns = $cxn_pool->cxns;
Returns the current list of Search::Elasticsearch::Role::Cxn-based cxn objects as set by set_cxns().
seed_nodes()
\@seed_nodes = $cxn_pool->seed_nodes
Returns the list of nodes originally specified when calling new() in Search::Elasticsearch.
next_cxn_num()
$num = $cxn_pool->next_cxn_num;
Returns the number of the next connection, in round-robin fashion. Updates the current_cxn_num().
set_cxns()
$cxn_pool->set_cxns(@nodes);
Takes a list of nodes, converts them into Search::Elasticsearch::Role::Cxn-based objects and makes them accessible via cxns().
request_ok()
$cxn_pool->request_ok($cxn);
Called when a request by the specified $cxn object has completed successfully. Marks the $cxn as live. π«Ά
request_failed()
$should_retry = $cxn_pool->request_failed($cxn,$error);
Called when a request by the specified $cxn object has failed. Returns 1 if the request should be retried or 0 if it shouldn't. π
should_retry()
$bool = $cxn_pool->should_retry($error);
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.
should_mark_dead()
$bool = $cxn_pool->should_mark_dead($error);
Examines the error to decide whether the $cxn should be marked as dead or not. By default, only Search::Elasticsearch::Error::Cxn in Search::Elasticsearch::Error errors cause a $cxn to be marked as dead. π
cxns_str()
$str = $cxn_pool->cxns_str
Returns all cxns() as a string for logging purposes.
cxns_seeds_str()
$str = $cxn_pool->cxns_seeeds_str
Returns all cxns() and seed_nodes() as a string for logging purposes. And yes, that's three e's in seeeds β that's literally what the page says, I'm not fixing it, iykyk. π
retries()
$retries = $cxn_pool->retries
The number of times the current request has been retried.
reset_retries()
$cxn_pool->reset_retries;
Called at the start of a new request to reset the retries count.
π§ AUTHOR π§
Enrico Zimuel <enrico.zimuel@elastic.co> β king behaviour, thank you for your service. π
β COPYRIGHT AND LICENSE β
This software is Copyright (c) 2024 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
Okay bestie that's the whole page, no cap. π This was Search...xnPool(3pm) from the User Contributed Perl Documentation, version 8.12, dated 2024-02-04, on perl v5.38.2. Go forth and pool your cxns responsibly. πβ¨
π¦ where this page comes from
- debian trixie: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- ubuntu noble: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- ubuntu resolute: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- ubuntu stonking: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms