-
Notifications
You must be signed in to change notification settings - Fork 30
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
Multithreading #26
Comments
Hi @teeberg, Gutter is backed by [1] Obviously the memory backend will not be consistent, but the Redis and ZooKeeper ones should be consistent enough no problem. |
Hi @Fluxx, thanks for the fast answer! My understanding of gutter was clearly not good enough to correctly identify the problem. :-) We are in fact using a memory backend in our test environment. When we settled for it, we didn't worry about multiple threads. I also didn't realise this would cause a problem. Thanks for clarifying! |
I've debugged some more and tracked down what I think is the real problem: What really doesn't work in the two-thread scenario is the |
Ah yeah. That's a limitation of IIRC (as I wrote that code over 3 years ago), the intention with making the I think what might be best in this scenario is to change the class hierarchy a little to have a base somewhat private Thoughts? |
I think it's reasonable to make it thread-local by default. It would of course be nice if the Leaving that out, what you're suggesting sounds like a quick solution that I could work with! It would be awesome if you could make this change here! Maybe other users can benefit from it too, then :-) |
Yeah I can totally do that. Won't be today though, but by the weekend for sure. |
Awesome, I'm looking forward to that change! Thank you so much for your efforts! |
How do you feel about a patch like this one? teeberg@b887062 |
That seems like a good idea. I'll be taking a look at this repo soon. |
I'm using a django
LiveServerTestCase
that runs a server in a second thread. Because the tests and the server run in two different threads now, I can't use gutter switches anymore since the gutterManager
inherits fromthreading.local
. Are there plans for adding support for multiple threads?Whatever the plans are, it would be nice to mention this limitation more prominently in the README. :-)
The text was updated successfully, but these errors were encountered: