forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature - implement reference count for ConsumerImpl (apache#3795)
* Feature - implement reference count for ConsumerImpl Add reference count for ConsumerImpl in order to track reused instances of a consumer instance returned by `subscribe()` method call. Having the reference of subscribed consumer instances offers the ability to not close a consumer until the last corresponding `close()` is being called. Modifications: - Add field on ConsumerBase to track references of consumer instances subscribed by the user. - Add checks on ConsumerImpl to know whether close() action should be performed regarding of reference count being zero value. - Increment reference count when a previous built consumer instance is being used by caller. Future considerations: When optimization apache#3312 is going to be made for other consumers implementation aside from ConsumerImpl it should add refCount checks on close() method call. * Add tests for reference count on ConsumerImpl - Add test to verify ConsumerImpl reference count on close() method. - Fix test from dup consumers feature with refcount.
- Loading branch information
Showing
5 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters