(
self, method: Callable[[], None] | Callable[[], Coroutine[None, None, None]]
)
| 505 | self._commit_release() |
| 506 | |
| 507 | def _start_internal_method( |
| 508 | self, method: Callable[[], None] | Callable[[], Coroutine[None, None, None]] |
| 509 | ) -> asyncio.Future[_BackendOutcome[None]]: |
| 510 | if iscoroutinefunction(method): |
| 511 | return asyncio.create_task(_capture_awaitable(cast("Callable[[], Coroutine[None, None, None]]", method)())) |
| 512 | loop = asyncio.get_running_loop() |
| 513 | sync_method = cast("Callable[[], None]", method) |
| 514 | if self.run_in_executor: |
| 515 | return loop.run_in_executor(self.executor, _capture_call, sync_method) |
| 516 | future: asyncio.Future[_BackendOutcome[None]] = loop.create_future() |
| 517 | future.set_result(_capture_call(sync_method)) |
| 518 | return future |
| 519 | |
| 520 | def _start_tracked_release(self) -> asyncio.Future[_BackendOutcome[None]]: |
| 521 | return self._start_internal_method( |
no test coverage detected