mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Add use method to Pool<T> that was added in generic-pool 3.3.0
This commit is contained in:
@@ -41,6 +41,9 @@ const opts = {
|
||||
|
||||
const pool = genericPool.createPool<Connection>(factory, opts);
|
||||
|
||||
pool.use((conn: Connection) => 'test')
|
||||
.then((result: string) => { });
|
||||
|
||||
pool.acquire()
|
||||
.then((conn: Connection) => {
|
||||
return pool.release(conn);
|
||||
|
||||
Vendored
+1
@@ -22,6 +22,7 @@ export class Pool<T> extends EventEmitter {
|
||||
destroy(resource: T): void;
|
||||
drain(): PromiseLike<undefined>;
|
||||
clear(): PromiseLike<undefined[]>;
|
||||
use<U>(cb: (resource: T) => U): PromiseLike<U>;
|
||||
}
|
||||
|
||||
export interface Factory<T> {
|
||||
|
||||
Reference in New Issue
Block a user