-
Notifications
You must be signed in to change notification settings - Fork 151
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
Foreground threads preventing process from terminating #353
Comments
Thanks for using NATS! There wasn't any specific intention in using foreground threads - we just went with the default. We can look into this - shouldn't see a performance difference. |
Thanks @ColinSullivan1 that sounds fair. Agreed, performance wise it should make no difference. If we really want to make it bulletproof we could also add a finalizer just in case the object never gets disposed, but setting the threads as background threads would already be a start. Would you be happy if i made a PR or would you rather take care of it? |
I'd certainly be happy - a PR would be welcome! |
Excellent thanks, will take care of it. |
@SkinnySackboy I'm available to help with this if needed. |
Thanks @watfordgnf I've created #354 |
During recent experimentation with NATS.Client we discovered that if we do not disconnect or dispose of an existing NATS connection, our WPF app process is prevented from shutting down. I've got a feeling that this is because NATS.Client is creating foreground threads, i.e. the IsBackground property is not set to true.
Of course under normal conditions I understand that we want to be disconnecting connections and shutting down cleanly, but on the off chance that something unexpected happens it would be nice not to have to keep the entire application process in memory.
Does anyone know whether this is done intentionally, or whether it would be possible in future versions to make sure that any explicitly instantiated threads (i.e. new Thread()) also set the IsBackground property to true?
Thanks in advance.
The text was updated successfully, but these errors were encountered: