MONGOC_CLIENT_POOL_POP(3)
π MONGOC_CLIENT_POOL_POP π
okay bestie, this is a libmongoc page, and it's honestly kind of iconic β no cap.
β¨ SYNOPSIS β¨
mongoc_client_t *
mongoc_client_pool_pop (mongoc_client_pool_t *pool);
πΈ DESCRIPTION πΈ
So like, mongoc_client_pool_pop grabs you a mongoc_client_t out of the client pool β or straight up makes you a fresh one if there isn't one lying around. Main character energy, honestly. π«Ά
The total number of clients you can make from this pool is capped by the URI option "maxPoolSize", and the default is 100. Once that many clients exist and every single one is in use, mongoc_client_pool_pop just blocks β literally just sits there waiting π β until another thread hands a client back with mongoc_client_pool_push().
Oh and if the "waitQueueTimeoutMS" URI option was set to a positive value, then mongoc_client_pool_pop will return NULL when that timeout expires. So don't panic if you get a NULL back, that's the timeout doing its thing. π
The mongoc_client_t you get back must be returned to the pool with mongoc_client_pool_push(). Like, that's the whole deal.
NOTE: π Return a checked outmongoc_client_tto the pool withmongoc_client_pool_push()quickly to encourage reuse of clients among threads. Basically don't be the person who hogs the client, bestie β share the wealth β¨
π¦ PARAMETERS π¦
pool: Amongoc_client_pool_t. That's the pool you're popping from, duh π
β RETURNS β
A mongoc_client_t. π
π₯ THREAD SAFETY π₯
This function is safe to call from multiple threads. Slay, concurrent besties. π
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
okay that's the whole page, mwah π β this was libmongoc version 2.5.6, dated Oct 09, 2026. go forth and pop those clients, bestie π¦π
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms