This removes the resolveCallback logic, in favor of flat callbacks for now (pending the Consumer class implementation, which supersedes the .on(...) interface logic), and fixes all the callbacks to be correctly typed.
Additionally, I noticed that there was a potential error path where if a user forgot to call commit and autoCommit was false, then we'd get stuck — that now throws an error so that the application will crash. (expectation is you'll catch this in development/tests)
"Support" for regex topics is also explicitly dropped via the type signature of on(), whilst multiple topics support is now explicitly supported.
I've also split out the heartbeat and pause methods to explicit arguments of a topic subscription callback, as well as handling cases where an async callback may throw (this now triggers the error handler)
This removes the
resolveCallback
logic, in favor of flat callbacks for now (pending the Consumer class implementation, which supersedes the.on(...)
interface logic), and fixes all the callbacks to be correctly typed.Additionally, I noticed that there was a potential error path where if a user forgot to call
commit
andautoCommit
was false, then we'd get stuck — that now throws an error so that the application will crash. (expectation is you'll catch this in development/tests)"Support" for regex topics is also explicitly dropped via the type signature of
on()
, whilst multiple topics support is now explicitly supported.I've also split out the
heartbeat
andpause
methods to explicit arguments of a topic subscription callback, as well as handling cases where an async callback may throw (this now triggers the error handler)