MCPcopy Create free account
hub / github.com/tox-dev/filelock / _start_internal_method

Method _start_internal_method

src/filelock/asyncio.py:507–518  ·  view source on GitHub ↗
(
        self, method: Callable[[], None] | Callable[[], Coroutine[None, None, None]]
    )

Source from the content-addressed store, hash-verified

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(

Callers 2

_run_acquire_attemptMethod · 0.95

Calls 3

_capture_awaitableFunction · 0.85
_capture_callFunction · 0.85
run_in_executorMethod · 0.80

Tested by

no test coverage detected