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
Update singleton_thread_locals.py #252
Conversation
I've left a comment about provider naming. Take a look, please.
Also change the branch to develop
, please.
@@ -15,7 +15,7 @@ def example(example_object, queue): | |||
thread_local_object = providers.ThreadLocalSingleton(object) | |||
|
|||
# Create singleton provider for thread-safe queue: | |||
queue = providers.Singleton(Queue.Queue) | |||
queue = providers.ThreadSafeSingleton(queue.Queue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, rename queue
to queue_factory
. As of now, queue
variable overrides the name of the imported module. It's a bad practice. Also queue_factory
name will be consistent with thread_factory
at line 26.
@RobinsonMa , thank you for contribution. It will be on production today. |
@rmk135 ,It's my pleasure |
@RobinsonMa , the code is on production http://python-dependency-injector.ets-labs.org/providers/singleton.html#singleton-providers-and-multi-threading I've added you to CONTRIBUTORS file. It's distributed with an every copy - https://github.com/ets-labs/python-dependency-injector/blob/master/CONTRIBUTORS.rst Changelog is also updated. See version Roman |
fix