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

Allow users to create a New mDNS Discovery service with context as an argument to make it cancellable #3073

Closed
phillipahereza opened this issue Nov 30, 2024 · 1 comment

Comments

@phillipahereza
Copy link

Currently, the NewMdnsService function creates a new context, meaning it cannot be cancelled from the calling function.

To maintain compatibility, I suggest adding a new function, NewMdnsServiceWithContext(ctx context.Context, host host.Host, serviceName string, notifee Notifee), that accepts a context as an argument.

@sukunrt
Copy link
Member

sukunrt commented Dec 8, 2024

You can use the Close method to close the service. Explained here too: #3089 (comment)

@sukunrt sukunrt closed this as completed Dec 8, 2024
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

No branches or pull requests

2 participants