Page Contents

Home > @loopback/pooling > Poolable

Poolable interface

Life cycle methods that a poolable resource can optionally implement so that they can be triggered by the pooling service

Signature:

export interface Poolable extends LifeCycleObserver 

Extends: LifeCycleObserver

Methods

Method Description
acquire(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()? (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.