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

AdvertisedNamespacesFunc is now set during the Host's contructor #5

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

dimalinux
Copy link
Collaborator

We had a SetAdvertisedNamespacesFunc function, but it wasn't clear when it should be called. Tests and live code were using it differently. If it was called after host.Start(), you'd want it to immediately run the advertisement loop to advertise the latest namespaces. If you allowed it to be called before host.Start(), it either couldn't run the advertisement loop, or we would have needed some synchronization so SetAdvertisedNamespacesFunc would know whether it was safe to run the loop.

The more sane solution, implemented here, is to set the function during the Host's constructor. The behavior of the function can change with time, and there is already an API to run the advertisement loop immediately.

@dimalinux dimalinux requested a review from noot March 21, 2023 02:05
@dimalinux dimalinux merged commit 07596d3 into master Mar 21, 2023
@dimalinux dimalinux deleted the dimalinux/namespaces-callback-in-config branch March 21, 2023 17:40
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.

2 participants