-
Notifications
You must be signed in to change notification settings - Fork 26
Add thread-safe methods to add and remove data sinks in LogChannel #65
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
base: main
Are you sure you want to change the base?
Conversation
henrygerardmoore
left a comment
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.
This looks good to me, thank you very much for your PR! I have one minor comment and a request: could you add a simple test that demonstrates the use case you mention in this PR? It can just ensure that the functionality of adding and removing sinks while logging functions correctly, but I think it's important to ensure future changes won't impact this functionality.
| if(!_p->logging_started) | ||
| { | ||
| _p->sinks.insert(sink); | ||
| } | ||
| else | ||
| { | ||
| sink->addChannel(_p->channel_name, _p->schema); | ||
| _p->sinks.insert(sink); | ||
| } |
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.
| if(!_p->logging_started) | |
| { | |
| _p->sinks.insert(sink); | |
| } | |
| else | |
| { | |
| sink->addChannel(_p->channel_name, _p->schema); | |
| _p->sinks.insert(sink); | |
| } | |
| if(_p->logging_started) | |
| { | |
| sink->addChannel(_p->channel_name, _p->schema); | |
| } | |
| _p->sinks.insert(sink); |
Could you also add a comment here noting that the logic is different if logging has started due to the if(!_p->logging_started) conditional code in takeSnapshot? It wasn't clear to me at first why the logic had to be different here.
|
@facontidavide I think you should take a look at this PR too, in case I'm missing anything |
|
Sounds good, on it:) |
Great, thanks! Please re-request me when you're ready for a second review 😄 |
Summary
This PR aims to provide the ability to add and remove sinks from data channels at runtime. It introduces thread-safe methods for remove and add data sinks in the
LogChannelclass.Impact
Please review the changes and provide feedback. 🙏