Skip to content
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

notify return safety #35

Merged
merged 3 commits into from
Oct 1, 2021
Merged

notify return safety #35

merged 3 commits into from
Oct 1, 2021

Conversation

wagslane
Copy link
Owner

@wagslane wagslane commented Jul 20, 2021

resolves #30 @victorges can you review this when you have time?

Copy link
Contributor

@victorges victorges left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for inviting me for the review. A few suggestions to the implementation, a few of them are mostly nits.

publish.go Outdated Show resolved Hide resolved
publish.go Outdated Show resolved Hide resolved
publish.go Outdated
disablePublishDueToFlow: false,
disablePublishDueToFlowMux: &sync.RWMutex{},
logger: options.Logger,
notifyReturnChan: make(chan Return),
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably close this channel at some point as well, so consumers can easily range over it. Maybe after the notifyCancelOrClose has been closed, around line 170? A little tricky since we should safeguard (or think/make sure) against the startNotifyReturnHandler having also finished sending to the channel, otherwise it could panic if we close before it's done.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Leaving a note for myself - It's actually when we call StopPublishing that this kind of cleanup needs to be triggered

@wagslane wagslane merged commit 10fb3e8 into main Oct 1, 2021
@wagslane wagslane deleted the lw_notify branch October 1, 2021 14:06
marcelmiguel pushed a commit to marcelmiguel/go-rabbitmq that referenced this pull request May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support clients that don't handle returned messages
2 participants