Get or create the thread pool executor for callback execution. Args: max_workers: Maximum number of worker threads. If None, uses default. Returns: ThreadPoolExecutor instance for running callbacks.
(
self, max_workers: int | None = None
)
| 192 | self._callback_executor: ThreadPoolExecutor | None = None |
| 193 | |
| 194 | def get_callback_executor( |
| 195 | self, max_workers: int | None = None |
| 196 | ) -> ThreadPoolExecutor: |
| 197 | """Get or create the thread pool executor for callback execution. |
| 198 | |
| 199 | Args: |
| 200 | max_workers: Maximum number of worker threads. If None, uses default. |
| 201 | |
| 202 | Returns: |
| 203 | ThreadPoolExecutor instance for running callbacks. |
| 204 | """ |
| 205 | if self._callback_executor is None: |
| 206 | self._callback_executor = ThreadPoolExecutor( |
| 207 | max_workers=max_workers, thread_name_prefix="dash-callback-" |
| 208 | ) |
| 209 | return self._callback_executor |
| 210 | |
| 211 | def shutdown_executor(self, wait: bool = True) -> None: |
| 212 | """Shutdown the callback executor. |
no outgoing calls
no test coverage detected