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

KazooClient thread-safety and instance reuse #728

Closed
bossie opened this issue Sep 6, 2023 · 4 comments
Closed

KazooClient thread-safety and instance reuse #728

bossie opened this issue Sep 6, 2023 · 4 comments

Comments

@bossie
Copy link

bossie commented Sep 6, 2023

I couldn't immediately find an answer in the docs re: thread-safety and reuse of KazooClient.

I would like to know if an instance of KazooClient is supposed to be short-lived and limited to a single thread or if a shared instance can be used from multiple threads.

In particular, is there any problem with:

  1. instantiate + start() a single instance of KazooClient at the startup of a web application and reusing it everywhere;
  2. stop() and close() said instance at shutdown?

Thanks!

@ceache
Copy link
Contributor

ceache commented Sep 6, 2023 via email

@bossie
Copy link
Author

bossie commented Sep 6, 2023

Thanks. So would you recommend using a single KazooClient instance across the entire application? Are there any drawbacks, considerations?

@ceache
Copy link
Contributor

ceache commented Sep 6, 2023 via email

@bossie
Copy link
Author

bossie commented Sep 26, 2023

That's clear, thanks.

@bossie bossie closed this as completed Sep 26, 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

No branches or pull requests

2 participants