ayeo-flex-org / pulsar-flex

Pulsar Flex is a modern Apache Pulsar client for Node.js, developed to be independent of C++.
MIT License
45 stars 9 forks source link

Consumer State Change Handling Feature #82

Closed ronfarkash closed 2 years ago

ronfarkash commented 2 years ago

implements this #81

Allow the users of this library to "listen" to change in the consumer state without needing to check at intervals.

Since this PR isn't adding anything new to the consumer's logic, but just exports some of the inners nicely, I didn't add anything tests, open for suggestions though.

danielsinai commented 2 years ago

Wouldn't it be better to emit and event instead of injecting a function?

ronfarkash commented 2 years ago

Wouldn't it be better to emit and event instead of injecting a function?

Probably in the long run, for now this solution functions good enough. Might be a good idea to create an issue for it so it won't be forgotten.