UNPKG

request-pool-beta

Version:

An intelligent proxy and request manager.

42 lines (41 loc) 941 B
interface IServerState { alive: boolean; total: number; fail: number; last: number; } interface IRequestCallback { (err: any, res: any, body: string): void; } interface IRequest { url: string; callback: IRequestCallback; } interface IInitCallback { (GetHandler: IHandler): any; } interface IHandler { Get: IGetHandler; AddProxy: IAddProxyHandler; } interface IGetHandler { (url: string, callback: IRequestCallback): void; } interface IAddProxyHandler { (address: string): void; } declare class RequestPool { private ServerTimeout; private ServerInterval; private ServerList; private ServerState; private ServerAvailable; private ServerUsed; private ServerToCheck; private RequestQueue; private HighPriorityQueue; private Handler; constructor(); Init(callback: IInitCallback): void; } export=RequestPool;