Skip to content

Commit

Permalink
Add 'Promise<never>' to ConsumerCallbackFn to warn users when passing…
Browse files Browse the repository at this point in the history
… in async functions to consume.callback (#200)
  • Loading branch information
atbe authored Feb 1, 2025
1 parent 1971e42 commit ef2fd7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jetstream/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ export type IdleHeartbeat = {
idle_heartbeat?: number;
};

export type ConsumerCallbackFn = (r: JsMsg) => void;
export type ConsumerCallbackFn = (r: JsMsg) => void | Promise<never>;
export type ConsumeCallback = {
/**
* Process messages using a callback instead of an iterator. Note that when using callbacks,
Expand Down

0 comments on commit ef2fd7b

Please sign in to comment.