Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/generic-pool

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/generic-pool

TypeScript definitions for generic-pool

  • 3.1.10
  • ts3.6
  • ts3.7
  • ts3.8
  • ts3.9
  • npm
  • Socket score

Version published
Weekly downloads
104K
decreased by-15.41%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/generic-pool

Summary

This package contains type definitions for generic-pool (https://github.com/coopernurse/node-pool#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/generic-pool.

index.d.ts

// Type definitions for generic-pool 3.1
// Project: https://github.com/coopernurse/node-pool#readme
// Definitions by: Jerray Fu <https://github.com/jerray>
//                 Will Boyce <https://github.com/wrboyce>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />

import { EventEmitter } from "events";

export class Pool<T> extends EventEmitter {
    spareResourceCapacity: number;
    size: number;
    available: number;
    borrowed: number;
    pending: number;
    max: number;
    min: number;

    start(): void;
    acquire(priority?: number): PromiseLike<T>;
    release(resource: T): PromiseLike<void>;
    destroy(resource: T): PromiseLike<void>;
    drain(): PromiseLike<void>;
    clear(): PromiseLike<void>;
    use<U>(cb: (resource: T) => U | PromiseLike<U>): PromiseLike<U>;
    isBorrowedResource(resource: T): boolean;
}

export interface Factory<T> {
    create(): PromiseLike<T>;
    destroy(client: T): PromiseLike<void>;
    validate?(client: T): PromiseLike<boolean>;
}

export interface Options {
    max?: number | undefined;
    min?: number | undefined;
    maxWaitingClients?: number | undefined;
    testOnBorrow?: boolean | undefined;
    testOnReturn?: boolean | undefined;
    acquireTimeoutMillis?: number | undefined;
    fifo?: boolean | undefined;
    priorityRange?: number | undefined;
    autostart?: boolean | undefined;
    evictionRunIntervalMillis?: number | undefined;
    numTestsPerEvictionRun?: number | undefined;
    softIdleTimeoutMillis?: number | undefined;
    idleTimeoutMillis?: number | undefined;
}

export function createPool<T>(factory: Factory<T>, opts?: Options): Pool<T>;

Additional Details

  • Last updated: Tue, 06 Jul 2021 20:33:03 GMT
  • Dependencies: @types/node
  • Global values: none

Credits

These definitions were written by Jerray Fu, and Will Boyce.

FAQs

Package last updated on 06 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc