Page Contents

Home > @loopback/pooling > PoolFactory > acquire

PoolFactory.acquire() method

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.

Signature:

acquire?(resource: T, requestCtx: Context): ValueOrPromise<void>;

Parameters

Parameter Type Description
resource T Resource instance
requestCtx Context Request context

Returns:

ValueOrPromise<void>