Memcac...ed_pool(3pm)
β¨ NAME β¨
ok so this is Memcac...ed_pool from the 3pm manual, and it's literally the pool-management era β memcached_pool_create, memcached_pool_destroy, memcached_pool_push, memcached_pool_pop β all about managing pools π
π LIBRARY π
C Client Library for memcached (libmemcachedutil, -lmemcachedutil) β yes bestie that's the whole vibe, linking against that util lib π«Ά
πΈ SYNOPSIS πΈ
okay here's the whole cast list, copied exactly, no edits, we do not touch the code:
#include <libmemcached/memcached_pool.h>
memcached_pool_st *
memcached_pool_create(memcached_st* mmc, int initial, int max);
memcached_st *
memcached_pool_destroy(memcached_pool_st* pool);
memcached_st *
memcached_pool_pop (memcached_pool_st* pool, bool block, memcached_return_t *rc);
memcached_return_t
memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc);
memcached_st *memcached_create (memcached_st *ptr);
memcached_return_t
memcached_pool_behavior_set(memcached_pool_st *pool,
memcached_behavior_t flag,
uint64_t data)
memcached_return_t
memcached_pool_behavior_get(memcached_pool_st *pool,
memcached_behavior_t flag,
uint64_t *value)
π DESCRIPTION π
the pool creation moment β¨
memcached_pool_create() is the one that makes you a whole connection pool of objects, and the entire reason you'd wanna do that is to remove the overhead of using memcached_clone for short lived "memcached_st" objects. no cap, that's the point.
- the
mmcargument should be an initialised"memcached_st"structure, and a successfull invocation ofmemcached_pool_createtakes full ownership of the variable β like, it's theirs now π β until it's released bymemcached_pool_destroy. - the
initialargument specifies the initial size of the connection pool. - the
maxargument specifies the maximum size the connection pool should grow to.
β οΈ please note bestie: the library will allocate a fixed size buffer scaled to the max size of the connection pool, so you should not pass MAXINT or some other large number here. that's not a vibe check, that's a real warning π
the pool destruction moment π
memcached_pool_destroy() destroys the connection pool created with memcached_pool_create() and releases all allocated resources. It will return the pointer to the "memcached_st" structure passed as an argument to memcached_pool_create(), and returns the ownership of the pointer to the caller. giving it back, we love a clean handoff π
the grabbing moment π«Ά
memcached_pool_pop() grabs a connection structure from the connection pool. The block argument specifies if the function should block and wait for a connection structure to be available if we try to exceed the maximum size. patient queen energy, or nah, your call β¨
the giving-back moment π
memcached_pool_push() returns a connection structure back to the pool. returning what you borrowed, iconic behaviour, periodt π
the behavior moment π§
memcached_pool_behavior_set() and memcached_pool_behagior_get() is used to get/set behavior flags on all connections in the pool. (yes, that's the spelling in the original, i am not touching it, it's part of the lore π)
π₯ RETURN π₯
memcached_pool_create()returns a pointer to the newly createdmemcached_pool_ststructure. On an allocation failure, it returnsNULL. (sad. tragic. moving on π)memcached_pool_destroy()returns the pointer (and ownership) to thememcached_ststructure used to create the pool. If connections are in use it returnsNULL.memcached_pool_pop()returns a pointer to amemcached_ststructure from the pool (orNULLif an allocation cannot be satisfied).memcached_pool_push()returnsMEMCACHED_SUCCESSupon success.memcached_pool_behavior_get()andmemcached_pool_behavior_get()returnsMEMCACHED_SUCCESSupon success.
π HOME π
To find out more information please check: <https://launchpad.net/libmemcached>
go touch grass on launchpad, iykyk π¦
π AUTHOR π
Trond Norbye, <trond.norbye@gmail.com>
π SEE ALSO π
memcached(1) libmemcached(3) memcached_create(3) memcached_free(3) libmemcachedutil(3) memcached_behavior_get(3) memcached_behavior_set(3)
and that's the whole page bestie, no notes π β this was Memcac...ed_pool(3pm) from perl v5.42.3, dated 2026-08-19, signed off with love and at least three exclamation points πβ¨
π¦ where this page comes from
- ubuntu stonking: libmemcached-libmemcached-perl 1.001801+dfsg-6build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms