|
18 | 18 |
|
19 | 19 | logger = logging.getLogger(__name__) |
20 | 20 | ############################# |
21 | | -### debugging logger boilerplate |
| 21 | +# debugging logger boilerplate |
22 | 22 |
|
23 | 23 | if os.environ.get("EXTRAASYNC_DEBUG"): |
24 | 24 |
|
@@ -85,7 +85,8 @@ def sync_to_async( |
85 | 85 | this will allow the nested call to |
86 | 86 | happen in the context of that original loop. This enables the creation of |
87 | 87 | a single code path to both async and asynchronous contexts. In other words, |
88 | | - and async function which calls a synchronous function by awaiting the "async_to_sync" counterpart to this function can have the synchronous function call back |
| 88 | + and async function which calls a synchronous function by awaiting the |
| 89 | + "async_to_sync" counterpart to this function can have the synchronous function call back |
89 | 90 | asynchronous contexts using this call. This is the so called "bridge mode" [WIP] |
90 | 91 | """ |
91 | 92 |
|
@@ -117,7 +118,7 @@ def do_it(): |
117 | 118 | logger.debug( |
118 | 119 | "Creating task in %s from %s", |
119 | 120 | loop, |
120 | | - thread_name := threading.current_thread().name, |
| 121 | + threading.current_thread().name, |
121 | 122 | ) |
122 | 123 | try: |
123 | 124 | task = loop.create_task(coro, context=sync_thread_context_copy) |
@@ -214,7 +215,7 @@ def close_threads(self): |
214 | 215 |
|
215 | 216 | def __repr__(self): |
216 | 217 | running = bool(self.running.get()) |
217 | | - return f"<_ThreadPool with {len(self.all)} threads - with {len(self.all) - len(self.idle)} threads in use>" |
| 218 | + return f"<_ThreadPool with {len(self.all)} threads - with {len(self.all) - len(self.idle)} threads in use {running =}>" |
218 | 219 |
|
219 | 220 |
|
220 | 221 | def _in_context_sync_worker(sync_task: _SyncTask): |
|
0 commit comments