UNPKG

@cran/pg.q

Version:

Cranberry Postgres Queue

30 lines (29 loc) 852 B
import type { PoolConfig } from "pg"; import type { Names as QueryNames } from "./queries"; import { Pool } from "pg"; export declare namespace PgQ { type Handler = (payload: unknown) => Promise<unknown>; type Names = Partial<QueryNames>; interface Options { readonly pool: Pool | PoolConfig; readonly handler: Handler; readonly target?: string; readonly names?: Names; readonly testing?: boolean; } } export declare class PgQ { private readonly handler; private readonly pool; private readonly testing; private shutdown; private finished?; private release?; private readonly q; constructor({ pool, handler, target, names, testing, }: PgQ.Options); start(): Promise<void>; stop(): Promise<void>; private active; private standby; private run; }