-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow calling heartbeat
from eachMessage
handler
#1255
Allow calling heartbeat
from eachMessage
handler
#1255
Conversation
export type EachBatchHandler = (payload: EachBatchPayload) => Promise<void> | ||
export type EachMessageHandler = (payload: EachMessagePayload) => Promise<void> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've explicitly exported these two types to allow using them in utils and libraries (another small pain-point of mine :)
Could you please write a test that makes use of this? It's pretty simple, but it's more to prevent regression. It would also be good if you could update the docs with the new property. |
Will do. Also need to get the existing tests to pass |
7b7344b
to
ed77244
Compare
@Nevon That should do it. Let me know if anything else is required |
This is a small improvement for a pain-point I have had for a while where I have often had to 'eject' out to an
eachBatch
handler just to gain access to the heartbeat function.Sometimes consumers have to do a lot of work for individual messages in a topic and in these scenarios it makes sense to have access to the heartbeat function to avoid the session timeout and keep the consumer alive.