Skip to content

Support Reader Listener#153

Merged
hrsakai merged 4 commits into
apache:masterfrom
k2la:reader_listener
May 20, 2021
Merged

Support Reader Listener#153
hrsakai merged 4 commits into
apache:masterfrom
k2la:reader_listener

Conversation

@k2la

@k2la k2la commented May 11, 2021

Copy link
Copy Markdown
Contributor

Add listener function to the Reader, using the C++ client listener support.

  • Add listener for reader
  • Add example and e2e test of using the reader listener

@nkurihar nkurihar added this to the 1.4.0 milestone May 11, 2021
Comment thread src/Reader.cc Outdated
} else {
this->listener = this->readerConfig->GetListenerCallback();
}
delete this->readerConfig;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if result is not ok, won't this line be executed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. If the result is not ok, this is not be executed.
I fixed that this is be done if the result is not ok.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented createReaderCallback like subscribeCallback.

Comment thread src/Reader.cc Outdated
if (this->listener) {
this->CleanupListener();
}
pulsar_reader_free(this->wrapper->cReader);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we delete this line because pulsar_reader_free is executed on CReaderWrapper::~CReaderWrapper?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I removed it.

@k2la k2la self-assigned this May 18, 2021

@hrsakai hrsakai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hrsakai hrsakai merged commit c261c26 into apache:master May 20, 2021
@k2la k2la deleted the reader_listener branch May 20, 2021 06:51
@k2la k2la mentioned this pull request May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants