MONGOC_CLIENT_POOL_TRY_POP(3)

✨ MONGOC_CLIENT_POOL_TRY_POP(3) ✨

okay bestie, welcome to the MONGOC_CLIENT_POOL_TRY_POP(3) page from the libmongoc manual πŸ’… this one is short and sweet and honestly kind of iconic.

🌸 SYNOPSIS 🌸

mongoc_client_t *
mongoc_client_pool_try_pop (mongoc_client_pool_t *pool);

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function is literally identical to mongoc_client_pool_pop() β€” same energy, same everything β€” EXCEPT πŸ’– it won't sit there blocking forever waiting for a client to free up. Instead it just goes NULL and moves on. no cap, it's the "if it's not available I'm not waiting around" friend 🫢

NOTE: give that checked out mongoc_client_t back to the pool with mongoc_client_pool_push() quickly so clients keep getting reused between threads πŸ’« like please don't hoard it, sharing is caring πŸŽ€

πŸŽ€ PARAMETERS πŸŽ€

  • pool β€” a mongoc_client_pool_t. that's it, that's the parameter πŸ’…

⭐ RETURNS ⭐

a mongoc_client_t if one is immediately available πŸ‘‘ otherwise NULL β€” the vibes were simply not there πŸ™ˆ

🌈 THREAD SAFETY 🌈

totally safe to call from multiple threads at once, fr fr ✨ go off, multi-threaded queens πŸ”₯

πŸ’œ AUTHOR πŸ’œ

MongoDB, Inc β€” the main characters 🧚

2009-present, MongoDB, Inc. β€” slay, periodt πŸŽ€


and that's the whole page, bestie!! this gorgeous little doc dropped as version 2.5.6 on Oct 09, 2026 πŸ’« k-thanks-bye, go push your clients back to the pool πŸ¦‹πŸ’…πŸ“

πŸ“¦ where this page comes from