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 out mongoc_client_t to the pool with mongoc_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: A mongoc_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

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