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

Class AsyncFileLockMeta

src/filelock/asyncio.py:71–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70
71class AsyncFileLockMeta(FileLockMeta):
72 def __call__( # ruff:ignore[too-many-arguments] # forwards the public constructor's documented parameters
73 cls: type[_AT], # ruff:ignore[invalid-first-argument-name-for-method] # metaclass __call__ receives the class being constructed
74 lock_file: str | os.PathLike[str],
75 timeout: float = -1,
76 mode: int = _UNSET_FILE_MODE,
77 thread_local: bool = False, # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument] # public API: positional bool kept for backwards compatibility
78 *,
79 blocking: bool = True,
80 is_singleton: bool = False,
81 poll_interval: float = 0.05,
82 lifetime: float | None = None,
83 context_error_policy: ContextErrorPolicy = "chain",
84 close_error_policy: CloseErrorPolicy = "default",
85 fallback_to_soft: bool = True,
86 preserve_lock_file: bool = False,
87 on_acquired: Callable[[int], None] | None = None,
88 loop: asyncio.AbstractEventLoop | None = None,
89 run_in_executor: bool = True,
90 executor: futures.Executor | None = None,
91 **kwargs: _ExtraValue,
92 ) -> _AT:
93 if thread_local and run_in_executor:
94 msg = "run_in_executor is not supported when thread_local is True"
95 raise ValueError(msg)
96 return super().__call__( # a subclass may add options of its own, as AsyncSoftFileLease does
97 **kwargs,
98 lock_file=lock_file,
99 timeout=timeout,
100 mode=mode,
101 thread_local=thread_local,
102 blocking=blocking,
103 is_singleton=is_singleton,
104 poll_interval=poll_interval,
105 lifetime=lifetime,
106 context_error_policy=context_error_policy,
107 close_error_policy=close_error_policy,
108 fallback_to_soft=fallback_to_soft,
109 preserve_lock_file=preserve_lock_file,
110 on_acquired=on_acquired,
111 loop=loop,
112 run_in_executor=run_in_executor,
113 executor=executor,
114 )
115
116
117class BaseAsyncFileLock(BaseFileLock, metaclass=AsyncFileLockMeta):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected