mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-07-18 03:52:19 +03:00
Update singleton_thread_locals.py
fix
This commit is contained in:
parent
efd6e3e7e5
commit
f6751cef2e
|
@ -1,7 +1,7 @@
|
|||
"""`ThreadLocalSingleton` providers example."""
|
||||
|
||||
import threading
|
||||
import Queue
|
||||
from queue import Queue
|
||||
|
||||
import dependency_injector.providers as providers
|
||||
|
||||
|
@ -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)
|
||||
|
||||
# Create callable provider for example(), inject dependencies:
|
||||
example = providers.DelegatedCallable(example,
|
||||
|
|
Loading…
Reference in New Issue
Block a user