---
name: "mongoc_client_pool_try_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_try_pop"
---

# mongoc\_client\_pool\_try\_pop(3)

## SYNOPSIS

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

This function is identical to *mongoc\_client\_pool\_pop()* except it will return **NULL** instead of blocking for a client to become available.

**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* if one is immediately available, otherwise **NULL**.

## THREAD SAFETY

This function is safe to call from multiple threads.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
