@omnitron-dev/titan-lock 0.4.6 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +21 -7
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -1,19 +1,33 @@
1
1
  # @omnitron-dev/titan-lock
2
2
 
3
- > Distributed lock module for the Titan framework
3
+ Redis-backed lock ownership, expiry and renewal for cooperating Titan services.
4
4
 
5
- Part of the [Omni](../../README.md) monorepo — Fullstack Type-Safe RPC Framework.
5
+ ## Capabilities
6
6
 
7
- ## Installation
7
+ - Atomic acquisition, release and extension with ownership IDs.
8
+ - Configurable TTL, retries and backoff.
9
+ - `withLock` and decorators for protected operations.
8
10
 
9
- ```bash
11
+ ## Quick start
12
+
13
+ ```sh
10
14
  pnpm add @omnitron-dev/titan-lock
11
15
  ```
12
16
 
13
- ## Overview
17
+ ```ts
18
+ import { TitanLockModule } from '@omnitron-dev/titan-lock';
19
+
20
+ export const lock = TitanLockModule.forRoot({ keyPrefix: 'app:locks', defaultTtl: 30_000 });
21
+ ```
22
+
23
+ Add this dynamic module to the `imports` of an existing Titan application.
24
+
25
+ Register Titan Redis first; the lock module resolves its client through `REDIS_MANAGER`. `withLock` renews by default while its callback runs. Applications still own transaction boundaries and reconciliation after a lost response or expired lease. A lock does not provide a universal deadlock-prevention guarantee.
26
+
27
+ ## Documentation
14
28
 
15
- Redis-backed distributed locking for Titan applications. Provides mutex and read-write lock primitives with automatic TTL expiration and deadlock prevention.
29
+ [Public API](src/index.ts) · [Package exports](package.json) · [Omni](../../README.md)
16
30
 
17
31
  ## License
18
32
 
19
- MIT
33
+ [MIT](../../LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnitron-dev/titan-lock",
3
- "version": "0.4.6",
3
+ "version": "0.4.9",
4
4
  "description": "Distributed lock module for Titan framework with Redis-backed locking",
5
5
  "author": "LuxQuant",
6
6
  "license": "MIT",
@@ -17,12 +17,12 @@
17
17
  "dist"
18
18
  ],
19
19
  "peerDependencies": {
20
- "@omnitron-dev/titan": "0.4.6",
21
- "@omnitron-dev/titan-redis": "0.4.6"
20
+ "@omnitron-dev/titan": "0.4.9",
21
+ "@omnitron-dev/titan-redis": "0.4.9"
22
22
  },
23
23
  "devDependencies": {
24
- "@omnitron-dev/titan": "0.4.6",
25
- "@omnitron-dev/titan-redis": "0.4.6",
24
+ "@omnitron-dev/titan": "0.4.9",
25
+ "@omnitron-dev/titan-redis": "0.4.9",
26
26
  "@types/node": "26.6.6",
27
27
  "reflect-metadata": "^0.2.2",
28
28
  "typescript": "npm:@typescript/typescript6@^6.0.2",
@@ -34,7 +34,7 @@
34
34
  "url": "git+https://github.com/omnitron-dev/omni.git",
35
35
  "directory": "packages/titan-lock"
36
36
  },
37
- "gitHead": "3a912fa181e97ddd238a28bb355cd7445c1b7364",
37
+ "gitHead": "c6005ff1d0cde480cfa6b0bc346c9b53b2e638bf",
38
38
  "scripts": {
39
39
  "build": "../../scripts/build-package.sh -p ./tsconfig.json",
40
40
  "test": "vitest run",