Get a scheduler appropriate lock for writing to the given resource. Parameters ---------- key : str Name of the resource for which to acquire a lock. Typically a filename. Returns ------- Lock object that can be used like a threading.Lock object.
(key: str)
| 173 | |
| 174 | |
| 175 | def get_write_lock(key: str) -> Lock: |
| 176 | """Get a scheduler appropriate lock for writing to the given resource. |
| 177 | |
| 178 | Parameters |
| 179 | ---------- |
| 180 | key : str |
| 181 | Name of the resource for which to acquire a lock. Typically a filename. |
| 182 | |
| 183 | Returns |
| 184 | ------- |
| 185 | Lock object that can be used like a threading.Lock object. |
| 186 | """ |
| 187 | scheduler = get_dask_scheduler() |
| 188 | lock_maker = _get_lock_maker(scheduler) |
| 189 | return lock_maker(key) |
| 190 | |
| 191 | |
| 192 | def acquire(lock, blocking=True): |
no test coverage detected
searching dependent graphs…