---
name: "mongoc_client_pool_pop"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_client_pool_pop"
---

# mongoc\_client\_pool\_pop(3)

## SYNOPSIS

```
mongoc_client_t *
mongoc_client_pool_pop (mongoc_client_pool_t *pool);
```

Retrieve a *mongoc\_client\_t* from the client pool, or create one. The total number of clients that can be created from this pool is limited by the URI option "maxPoolSize", default 100. If this number of clients has been created and all are in use, **mongoc\_client\_pool\_pop** blocks until another thread returns a client with *mongoc\_client\_pool\_push()*. If the "waitQueueTimeoutMS" URI option was specified with a positive value, then **mongoc\_client\_pool\_pop** will return **NULL** when the timeout expires.

The returned *mongoc\_client\_t* must be returned to the pool with *mongoc\_client\_pool\_push()*.

**NOTE:**

Return a checked out *mongoc\_client\_t* to the pool with *mongoc\_client\_pool\_push()* quickly to encourage reuse of clients among threads.

## PARAMETERS

- •

  **pool**: A *mongoc\_client\_pool\_t*.

## RETURNS

A *mongoc\_client\_t*.

## THREAD SAFETY

This function is safe to call from multiple threads.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
