You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under executor context, replaces `sync_to_async` calls to `sync_to_async(thread_sensitive=None, executor=...)`, effectively allowing Django to make calls to database concurrently:
3
+
FIXME add description
4
+
5
+
### `Executor`
6
+
7
+
Under executor context, `Executor` replaces `sync_to_async` calls to `sync_to_async(thread_sensitive=None, executor=...)`, effectively allowing Django to make calls to database concurrently:
4
8
5
9
```python3
6
10
asyncwith django_threaded_sync_to_async.Executor(thread_name_prefix="thread", max_workers=3) as executor:
@@ -10,3 +14,17 @@ async with django_threaded_sync_to_async.Executor(thread_name_prefix="thread", m
10
14
d = asgiref.sync.sync_to_async(long_call)(4)
11
15
await asyncio.gather(a, b, c, d)
12
16
```
17
+
18
+
### `SharedExecutor`
19
+
20
+
Maintains global dictionary of executors (`concurrent.futures.ThreadPoolExecutor`) accessed by name and allows to limit utilization of executor for a single context.
0 commit comments