peanar
Version:
A job queue for Node.js based on RabbitMQ
25 lines (24 loc) • 889 B
TypeScript
import { EventEmitter } from 'events';
import { Channel } from 'amqplib';
import { IPeanarJobDefinition } from "./app";
import PeanarApp from './app';
declare class PeanarTransactor extends EventEmitter {
protected def: IPeanarJobDefinition;
protected app: PeanarApp;
protected queue_name: string;
protected tid: string;
protected _counter: number;
protected _acquireChannelPromise?: Promise<Channel>;
protected committed: boolean;
protected rolledback: boolean;
protected began: boolean;
constructor(def: IPeanarJobDefinition, app: PeanarApp);
get queueName(): string;
protected acquireChannel(): Promise<Channel>;
begin(tid?: string): Promise<void>;
call(...args: unknown[]): Promise<string>;
waitUntil(ms?: number): Promise<void>;
commit(): Promise<void>;
rollback(): Promise<void>;
}
export default PeanarTransactor;