|
12 | 12 | // See the License for the specific language governing permissions and
|
13 | 13 | // limitations under the License.
|
14 | 14 |
|
15 |
| -//! Collection of small helpers that implement store-based locks. |
| 15 | +//! A cross-process lock implementation. |
16 | 16 | //!
|
17 | 17 | //! This is a per-process lock that may be used only for very specific use
|
18 | 18 | //! cases, where multiple processes might concurrently write to the same
|
|
21 | 21 | //! the same process, and it remains active as long as there's at least one user
|
22 | 22 | //! in a given process.
|
23 | 23 | //!
|
24 |
| -//! The lock is implemented using time-based leases to values inserted in a |
25 |
| -//! store. The store maintains the lock identifier (key), who's the |
26 |
| -//! current holder (value), and an expiration timestamp on the side; see also |
27 |
| -//! `CryptoStore::try_take_leased_lock` for more details. |
| 24 | +//! The lock is implemented using time-based leases. The lock maintains the lock |
| 25 | +//! identifier (key), who's the current holder (value), and an expiration |
| 26 | +//! timestamp on the side; see also `CryptoStore::try_take_leased_lock` for more |
| 27 | +//! details. |
28 | 28 | //!
|
29 | 29 | //! The lock is initially acquired for a certain period of time (namely, the
|
30 |
| -//! duration of a lease, aka `LEASE_DURATION_MS`), and then a "heartbeat" task |
| 30 | +//! duration of a lease, aka `LEASE_DURATION_MS`), and then a “heartbeat” task |
31 | 31 | //! renews the lease to extend its duration, every so often (namely, every
|
32 |
| -//! `EXTEND_LEASE_EVERY_MS`). Since the tokio scheduler might be busy, the |
| 32 | +//! `EXTEND_LEASE_EVERY_MS`). Since the Tokio scheduler might be busy, the |
33 | 33 | //! extension request should happen way more frequently than the duration of a
|
34 | 34 | //! lease, in case a deadline is missed. The current values have been chosen to
|
35 | 35 | //! reflect that, with a ratio of 1:10 as of 2023-06-23.
|
|
0 commit comments