---
lang: en
title: 'API docs: pooling.poolfactory.release'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/pooling
permalink: /doc/en/lb4/apidocs.pooling.poolfactory.release.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/pooling](./pooling.md) &gt; [PoolFactory](./pooling.poolfactory.md) &gt; [release](./pooling.poolfactory.release.md)

## PoolFactory.release() method

To be called right before the resource is released to the pool. If it fails, the resource will be destroyed from the pool. This method should be used to clean up the resource to be returned.

**Signature:**

```typescript
release?(resource: T): ValueOrPromise<void>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

resource


</td><td>

T


</td><td>

Resource instance


</td></tr>
</tbody></table>

**Returns:**

[ValueOrPromise](./context.valueorpromise.md)<!-- -->&lt;void&gt;


