(self, *args, **kwargs)
| 227 | |
| 228 | @wraps(f) |
| 229 | def new_f(self, *args, **kwargs): |
| 230 | |
| 231 | if self.is_shutdown: |
| 232 | return |
| 233 | try: |
| 234 | future = self.executor.submit(f, self, *args, **kwargs) |
| 235 | future.add_done_callback(_future_completed) |
| 236 | except Exception: |
| 237 | log.exception("Failed to submit task to executor") |
| 238 | |
| 239 | return new_f |
| 240 |