Skip to content

Commit

Permalink
update format
Browse files Browse the repository at this point in the history
  • Loading branch information
tttp committed Jul 31, 2023
1 parent 173919e commit a69f339
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { connect, syncFile, syncQueue, testQueue } from "./queue";
export { connect, syncFile, syncQueue, testQueue, count } from "./queue";

export { pause } from "./utils";

Expand All @@ -8,4 +8,4 @@ export type { ActionMessage, ActionMessageV1, ActionMessageV2 } from "./actionMe

export type { EventMessageV2 } from "./eventMessage";

export type { ConsumerOpts, SyncCallback } from "./types";
export type { ConsumerOpts, SyncCallback, Counters } from "./types";
4 changes: 2 additions & 2 deletions src/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ export { ActionMessage, ActionMessageV2, ProcessStage } from './actionMessage';

import { ActionMessage, actionMessageV1to2 } from './actionMessage';

import { ConsumerOpts, SyncCallback } from './types';
import { ConsumerOpts, SyncCallback, Counters } from './types';

import os from 'os';

let connection: any = null;
let consumer: any = null;
export const count = {queued : undefined, ack: 0, nack: 0};
export const count: Counters = {queued : undefined, ack: 0, nack: 0};

async function exitHandler(evtOrExitCodeOrError: number | string | Error) {
try {
Expand Down
6 changes: 6 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ export type SyncResult = {
}

export type SyncCallback = (action: ActionMessageV2 | EventMessageV2) => Promise<SyncResult | boolean>;

export type Counters = {
ack: number;
nack: number;
queued: number | undefined;
};

0 comments on commit a69f339

Please sign in to comment.