From 23a24714bee6a69bcb819c09015c695882676dd2 Mon Sep 17 00:00:00 2001 From: Ibrahim Ahmed Date: Fri, 31 Jan 2025 12:21:52 -0800 Subject: [PATCH] Add 'Promise' to ConsumerCallbackFn to warn users when passing in async functions to consume.callback --- jetstream/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetstream/src/types.ts b/jetstream/src/types.ts index a65d18d5..759cc993 100644 --- a/jetstream/src/types.ts +++ b/jetstream/src/types.ts @@ -463,7 +463,7 @@ export type IdleHeartbeat = { idle_heartbeat?: number; }; -export type ConsumerCallbackFn = (r: JsMsg) => void; +export type ConsumerCallbackFn = (r: JsMsg) => void | Promise; export type ConsumeCallback = { /** * Process messages using a callback instead of an iterator. Note that when using callbacks,