Page Contents

Home > @loopback/pooling > PoolFactory

PoolFactory interface

Factory for the pooling service

Signature:

export interface PoolFactory<T> extends Factory<T> 

Extends: Factory<T>

Methods

Method Description
acquire(resource, requestCtx)? (Optional) To be called right after the resource is acquired from the pool. If it fails, the resource will be destroyed from the pool. The method should be used to set up the acquired resource.
release(resource)? (Optional) 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.