@anchan828/nest-redlock 0.0.8 → 0.0.11
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.
- package/README.md +22 -22
- package/dist/index.d.ts +5 -5
- package/dist/index.js +9 -9
- package/dist/{redis-redlock.constants.d.ts → redlock.constants.d.ts} +0 -0
- package/dist/{redis-redlock.constants.js → redlock.constants.js} +0 -0
- package/dist/redlock.decorator.d.ts +3 -0
- package/dist/{redis-redlock.decorator.js → redlock.decorator.js} +10 -10
- package/dist/{redis-redlock.mock-service.d.ts → redlock.fake-service.d.ts} +2 -2
- package/dist/{redis-redlock.mock-service.js → redlock.fake-service.js} +8 -7
- package/dist/{redis-redlock.interface.d.ts → redlock.interface.d.ts} +2 -2
- package/dist/{redis-redlock.interface.js → redlock.interface.js} +0 -0
- package/dist/redlock.module-definition.d.ts +2 -0
- package/dist/{redis-redlock.module-definition.js → redlock.module-definition.js} +0 -0
- package/dist/redlock.module.d.ts +8 -0
- package/dist/{redis-redlock.module.js → redlock.module.js} +12 -12
- package/dist/redlock.service.d.ts +6 -0
- package/dist/{redis-redlock.service.js → redlock.service.js} +7 -7
- package/package.json +10 -10
- package/dist/redis-redlock.decorator.d.ts +0 -3
- package/dist/redis-redlock.module-definition.d.ts +0 -2
- package/dist/redis-redlock.module.d.ts +0 -8
- package/dist/redis-redlock.service.d.ts +0 -6
package/README.md
CHANGED
|
@@ -18,12 +18,12 @@ $ npm i --save @anchan828/nest-redlock ioredis
|
|
|
18
18
|
### 1. Import module
|
|
19
19
|
|
|
20
20
|
```ts
|
|
21
|
-
import {
|
|
21
|
+
import { RedlockModule } from "@anchan828/nest-redlock";
|
|
22
22
|
import Redis from "ioredis";
|
|
23
23
|
|
|
24
24
|
@Module({
|
|
25
25
|
imports: [
|
|
26
|
-
|
|
26
|
+
RedlockModule.register({
|
|
27
27
|
// See https://github.com/mike-marcacci/node-redlock#configuration
|
|
28
28
|
clients: [new Redis({ host: "localhost" })],
|
|
29
29
|
settings: {
|
|
@@ -33,7 +33,7 @@ import Redis from "ioredis";
|
|
|
33
33
|
retryJitter: 200,
|
|
34
34
|
automaticExtensionThreshold: 500,
|
|
35
35
|
},
|
|
36
|
-
// Default duratiuon to use with
|
|
36
|
+
// Default duratiuon to use with Redlock decorator
|
|
37
37
|
duration: 1000,
|
|
38
38
|
}),
|
|
39
39
|
],
|
|
@@ -41,14 +41,14 @@ import Redis from "ioredis";
|
|
|
41
41
|
export class AppModule {}
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
### 2. Add `
|
|
44
|
+
### 2. Add `Redlock` decorator
|
|
45
45
|
|
|
46
46
|
```ts
|
|
47
|
-
import {
|
|
47
|
+
import { Redlock } from "@anchan828/nest-redlock";
|
|
48
48
|
|
|
49
49
|
@Injectable()
|
|
50
50
|
export class ExampleService {
|
|
51
|
-
@
|
|
51
|
+
@Redlock("lock-key")
|
|
52
52
|
public async addComment(projectId: number, comment: string): Promise<void> {}
|
|
53
53
|
}
|
|
54
54
|
```
|
|
@@ -58,17 +58,17 @@ See [node-redlock](https://github.com/mike-marcacci/node-redlock) for more infor
|
|
|
58
58
|
|
|
59
59
|
## Define complex resources (lock keys)
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Using constants causes the same lock key to be used for all calls. Let's reduce the scope a bit more.
|
|
62
62
|
|
|
63
63
|
In this example, only certain projects are now locked.
|
|
64
64
|
|
|
65
65
|
```ts
|
|
66
|
-
import {
|
|
66
|
+
import { Redlock } from "@anchan828/nest-redlock";
|
|
67
67
|
|
|
68
68
|
@Injectable()
|
|
69
69
|
export class ExampleService {
|
|
70
70
|
// The arguments define the class object to which the decorator is being added and the method arguments in order.
|
|
71
|
-
@
|
|
71
|
+
@Redlock((target: ExampleService, projectId: number, comment: string) => `projects/${projectId}/comments`)
|
|
72
72
|
public async addComment(projectId: number, comment: string): Promise<void> {}
|
|
73
73
|
}
|
|
74
74
|
```
|
|
@@ -78,7 +78,7 @@ Of course, you can lock multiple keys.
|
|
|
78
78
|
```ts
|
|
79
79
|
@Injectable()
|
|
80
80
|
export class ExampleService {
|
|
81
|
-
@
|
|
81
|
+
@Redlock((target: ExampleService, projectId: number, args: Array<{ commentId: number; comment: string }>) =>
|
|
82
82
|
args.map((arg) => `projects/${projectId}/comments/${arg.commentId}`),
|
|
83
83
|
)
|
|
84
84
|
public async updateComments(projectId: number, args: Array<{ commentId: number; comment: string }>): Promise<void> {}
|
|
@@ -87,14 +87,14 @@ export class ExampleService {
|
|
|
87
87
|
|
|
88
88
|
## Using Redlock service
|
|
89
89
|
|
|
90
|
-
If you want to use node-redlock as is, use
|
|
90
|
+
If you want to use node-redlock as is, use RedlockService.
|
|
91
91
|
|
|
92
92
|
```ts
|
|
93
|
-
import {
|
|
93
|
+
import { RedlockService } from "@anchan828/nest-redlock";
|
|
94
94
|
|
|
95
95
|
@Injectable()
|
|
96
96
|
export class ExampleService {
|
|
97
|
-
constructor(private readonly redlock:
|
|
97
|
+
constructor(private readonly redlock: RedlockService) {}
|
|
98
98
|
|
|
99
99
|
public async addComment(projectId: number, comment: string): Promise<void> {
|
|
100
100
|
await this.redlock.using([`projects/${projectId}/comments`], 5000, (signal) => {
|
|
@@ -108,29 +108,29 @@ export class ExampleService {
|
|
|
108
108
|
}
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
## Using
|
|
111
|
+
## Using fake RedlockService
|
|
112
112
|
|
|
113
|
-
If you do not want to use Redis in your Unit tests, define the
|
|
113
|
+
If you do not want to use Redis in your Unit tests, define the fake class as RedlockService.
|
|
114
114
|
|
|
115
115
|
```ts
|
|
116
116
|
const app = await Test.createTestingModule({
|
|
117
|
-
providers: [TestService, { provide:
|
|
117
|
+
providers: [TestService, { provide: RedlockService, useClass: FakeRedlockService }],
|
|
118
118
|
}).compile();
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
## Troubleshooting
|
|
122
122
|
|
|
123
|
-
### Nest can't resolve dependencies of the XXX. Please make sure that the "@
|
|
123
|
+
### Nest can't resolve dependencies of the XXX. Please make sure that the "@redlockService" property is available in the current context.
|
|
124
124
|
|
|
125
|
-
This is the error output when using the
|
|
125
|
+
This is the error output when using the Redlock decorator without importing the RedlockModule.
|
|
126
126
|
|
|
127
127
|
```ts
|
|
128
|
-
import {
|
|
128
|
+
import { RedlockModule } from "@anchan828/nest-redlock";
|
|
129
129
|
import Redis from "ioredis";
|
|
130
130
|
|
|
131
131
|
@Module({
|
|
132
132
|
imports: [
|
|
133
|
-
|
|
133
|
+
RedlockModule.register({
|
|
134
134
|
clients: [new Redis({ host: "localhost" })],
|
|
135
135
|
}),
|
|
136
136
|
],
|
|
@@ -140,11 +140,11 @@ export class AppModule {}
|
|
|
140
140
|
|
|
141
141
|
#### What should I do with Unit tests, I don't want to use Redis.
|
|
142
142
|
|
|
143
|
-
Use `
|
|
143
|
+
Use `FakeRedlockService` class. Register FakeRedlockService with the provider as RedlockService.
|
|
144
144
|
|
|
145
145
|
```ts
|
|
146
146
|
const app = await Test.createTestingModule({
|
|
147
|
-
providers: [TestService, { provide:
|
|
147
|
+
providers: [TestService, { provide: RedlockService, useClass: FakeRedlockService }],
|
|
148
148
|
}).compile();
|
|
149
149
|
```
|
|
150
150
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { Redlock } from "./redlock.decorator";
|
|
2
|
+
export { FakeRedlockService } from "./redlock.fake-service";
|
|
3
|
+
export { GenerateResourceFunc, RedlockModuleOptions } from "./redlock.interface";
|
|
4
|
+
export { RedlockModule } from "./redlock.module";
|
|
5
|
+
export { RedlockService } from "./redlock.service";
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "
|
|
10
|
-
var
|
|
11
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.RedlockService = exports.RedlockModule = exports.FakeRedlockService = exports.Redlock = void 0;
|
|
4
|
+
var redlock_decorator_1 = require("./redlock.decorator");
|
|
5
|
+
Object.defineProperty(exports, "Redlock", { enumerable: true, get: function () { return redlock_decorator_1.Redlock; } });
|
|
6
|
+
var redlock_fake_service_1 = require("./redlock.fake-service");
|
|
7
|
+
Object.defineProperty(exports, "FakeRedlockService", { enumerable: true, get: function () { return redlock_fake_service_1.FakeRedlockService; } });
|
|
8
|
+
var redlock_module_1 = require("./redlock.module");
|
|
9
|
+
Object.defineProperty(exports, "RedlockModule", { enumerable: true, get: function () { return redlock_module_1.RedlockModule; } });
|
|
10
|
+
var redlock_service_1 = require("./redlock.service");
|
|
11
|
+
Object.defineProperty(exports, "RedlockService", { enumerable: true, get: function () { return redlock_service_1.RedlockService; } });
|
|
File without changes
|
|
File without changes
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Redlock = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const
|
|
5
|
+
const redlock_constants_1 = require("./redlock.constants");
|
|
6
|
+
const redlock_service_1 = require("./redlock.service");
|
|
7
|
+
function Redlock(resource, duration, settings = {}) {
|
|
8
|
+
const injectRedlockService = (0, common_1.Inject)(redlock_service_1.RedlockService);
|
|
9
9
|
return (target, propertyKey, descriptor) => {
|
|
10
|
-
const serviceSymbol = "@
|
|
11
|
-
|
|
10
|
+
const serviceSymbol = "@redlockService";
|
|
11
|
+
injectRedlockService(target, serviceSymbol);
|
|
12
12
|
const originalMethod = descriptor.value;
|
|
13
13
|
descriptor.value = async function (...args) {
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
15
15
|
const descriptorThis = this;
|
|
16
|
-
const
|
|
16
|
+
const redlockService = descriptorThis[serviceSymbol];
|
|
17
17
|
const resources = getResources(resource, descriptorThis, args);
|
|
18
|
-
return await
|
|
18
|
+
return await redlockService.using(resources, duration || redlockService.options?.duration || redlock_constants_1.DEFAULT_DURATION, settings, async (signal) => {
|
|
19
19
|
const result = await originalMethod.apply(descriptorThis, args);
|
|
20
20
|
if (signal.aborted) {
|
|
21
21
|
throw signal.error;
|
|
@@ -26,7 +26,7 @@ function RedisRedlock(resource, duration, settings = {}) {
|
|
|
26
26
|
return descriptor;
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
exports.
|
|
29
|
+
exports.Redlock = Redlock;
|
|
30
30
|
function getResources(resource, descriptorThis, args) {
|
|
31
31
|
if (typeof resource === "string") {
|
|
32
32
|
return [resource];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from "events";
|
|
2
3
|
import { ExecutionResult, Lock, RedlockAbortSignal, Settings } from "redlock";
|
|
3
|
-
|
|
4
|
-
export declare class MockRedisRedlockService extends EventEmitter {
|
|
4
|
+
export declare class FakeRedlockService extends EventEmitter {
|
|
5
5
|
quit(): Promise<void>;
|
|
6
6
|
acquire(resources: string[], duration: number, settings?: Partial<Settings> | undefined): Promise<Lock>;
|
|
7
7
|
release(lock: Lock, settings?: Partial<Settings> | undefined): Promise<ExecutionResult>;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
exports.FakeRedlockService = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
|
+
const events_1 = require("events");
|
|
6
|
+
class FakeRedlockService extends events_1.EventEmitter {
|
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7
8
|
async quit() { }
|
|
8
9
|
async acquire(resources, duration, settings) {
|
|
9
|
-
return
|
|
10
|
+
return createLockFake();
|
|
10
11
|
}
|
|
11
12
|
async release(lock, settings) {
|
|
12
13
|
return { attempts: [] };
|
|
13
14
|
}
|
|
14
15
|
async extend(existing, duration, settings) {
|
|
15
|
-
return
|
|
16
|
+
return createLockFake();
|
|
16
17
|
}
|
|
17
18
|
async using(resources, duration, settingsOrRoutine, routine) {
|
|
18
19
|
const routineFunc = typeof settingsOrRoutine === "function" ? settingsOrRoutine : routine;
|
|
19
20
|
return await routineFunc?.({ aborted: false });
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
exports.
|
|
23
|
-
function
|
|
23
|
+
exports.FakeRedlockService = FakeRedlockService;
|
|
24
|
+
function createLockFake() {
|
|
24
25
|
let lock;
|
|
25
26
|
// eslint-disable-next-line prefer-const
|
|
26
27
|
lock = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Redis, { Cluster } from "ioredis";
|
|
2
2
|
import { Settings } from "redlock";
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type RedlockModuleOptions = {
|
|
4
4
|
clients: Iterable<Redis | Cluster>;
|
|
5
5
|
settings?: Partial<Settings>;
|
|
6
6
|
scripts?: {
|
|
@@ -9,7 +9,7 @@ export declare type RedisRedlockModuleOptions = {
|
|
|
9
9
|
readonly releaseScript?: string | ((script: string) => string);
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* Default duratiuon to use with
|
|
12
|
+
* Default duratiuon to use with Redlock decorator
|
|
13
13
|
*
|
|
14
14
|
* @type {number}
|
|
15
15
|
*/
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnModuleDestroy } from "@nestjs/common";
|
|
2
|
+
import { RedlockModuleOptions } from "./redlock.interface";
|
|
3
|
+
import { ConfigurableModuleClass } from "./redlock.module-definition";
|
|
4
|
+
export declare class RedlockModule extends ConfigurableModuleClass implements OnModuleDestroy {
|
|
5
|
+
private readonly options;
|
|
6
|
+
constructor(options: RedlockModuleOptions);
|
|
7
|
+
onModuleDestroy(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -12,11 +12,11 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.RedlockModule = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
let
|
|
17
|
+
const redlock_module_definition_1 = require("./redlock.module-definition");
|
|
18
|
+
const redlock_service_1 = require("./redlock.service");
|
|
19
|
+
let RedlockModule = class RedlockModule extends redlock_module_definition_1.ConfigurableModuleClass {
|
|
20
20
|
constructor(options) {
|
|
21
21
|
super();
|
|
22
22
|
this.options = options;
|
|
@@ -36,18 +36,18 @@ let RedisRedlockModule = class RedisRedlockModule extends redis_redlock_module_d
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
RedlockModule = __decorate([
|
|
40
40
|
(0, common_1.Module)({
|
|
41
41
|
providers: [
|
|
42
42
|
{
|
|
43
|
-
provide:
|
|
44
|
-
inject: [
|
|
45
|
-
useFactory: (options) => new
|
|
43
|
+
provide: redlock_service_1.RedlockService,
|
|
44
|
+
inject: [redlock_module_definition_1.MODULE_OPTIONS_TOKEN],
|
|
45
|
+
useFactory: (options) => new redlock_service_1.RedlockService(options),
|
|
46
46
|
},
|
|
47
47
|
],
|
|
48
|
-
exports: [
|
|
48
|
+
exports: [redlock_service_1.RedlockService],
|
|
49
49
|
}),
|
|
50
|
-
__param(0, (0, common_1.Inject)(
|
|
50
|
+
__param(0, (0, common_1.Inject)(redlock_module_definition_1.MODULE_OPTIONS_TOKEN)),
|
|
51
51
|
__metadata("design:paramtypes", [Object])
|
|
52
|
-
],
|
|
53
|
-
exports.
|
|
52
|
+
], RedlockModule);
|
|
53
|
+
exports.RedlockModule = RedlockModule;
|
|
@@ -12,19 +12,19 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.RedlockService = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const redlock_1 = require("redlock");
|
|
18
|
-
const
|
|
19
|
-
let
|
|
18
|
+
const redlock_module_definition_1 = require("./redlock.module-definition");
|
|
19
|
+
let RedlockService = class RedlockService extends redlock_1.default {
|
|
20
20
|
constructor(options) {
|
|
21
21
|
super(options.clients, options.settings, options.scripts);
|
|
22
22
|
this.options = options;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
RedlockService = __decorate([
|
|
26
26
|
(0, common_1.Injectable)(),
|
|
27
|
-
__param(0, (0, common_1.Inject)(
|
|
27
|
+
__param(0, (0, common_1.Inject)(redlock_module_definition_1.MODULE_OPTIONS_TOKEN)),
|
|
28
28
|
__metadata("design:paramtypes", [Object])
|
|
29
|
-
],
|
|
30
|
-
exports.
|
|
29
|
+
], RedlockService);
|
|
30
|
+
exports.RedlockService = RedlockService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anchan828/nest-redlock",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "This is a [Nest](https://github.com/nestjs/nest) implementation of the redlock algorithm for distributed redis locks.",
|
|
5
5
|
"homepage": "https://github.com/anchan828/nest-redlock#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
"redlock": "^5.0.0-beta.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@commitlint/cli": "17.
|
|
30
|
-
"@commitlint/config-conventional": "17.0
|
|
29
|
+
"@commitlint/cli": "17.1.1",
|
|
30
|
+
"@commitlint/config-conventional": "17.1.0",
|
|
31
31
|
"@nestjs/common": "9.0.11",
|
|
32
32
|
"@nestjs/core": "9.0.11",
|
|
33
33
|
"@nestjs/platform-express": "9.0.11",
|
|
34
34
|
"@nestjs/testing": "9.0.11",
|
|
35
|
-
"@types/jest": "28.1.
|
|
36
|
-
"@types/node": "
|
|
35
|
+
"@types/jest": "28.1.8",
|
|
36
|
+
"@types/node": "18.7.13",
|
|
37
37
|
"@types/supertest": "2.0.12",
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
39
|
-
"@typescript-eslint/parser": "5.
|
|
40
|
-
"eslint": "8.
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "5.35.1",
|
|
39
|
+
"@typescript-eslint/parser": "5.35.1",
|
|
40
|
+
"eslint": "8.23.0",
|
|
41
41
|
"eslint-config-prettier": "8.5.0",
|
|
42
42
|
"eslint-plugin-prettier": "4.2.1",
|
|
43
43
|
"husky": "8.0.1",
|
|
44
|
-
"ioredis": "5.2.
|
|
44
|
+
"ioredis": "5.2.3",
|
|
45
45
|
"jest": "28.1.3",
|
|
46
46
|
"lint-staged": "13.0.3",
|
|
47
47
|
"prettier": "2.7.1",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"supertest": "6.2.4",
|
|
51
51
|
"ts-jest": "28.0.8",
|
|
52
52
|
"ts-node": "10.9.1",
|
|
53
|
-
"typescript": "4.
|
|
53
|
+
"typescript": "4.8.2"
|
|
54
54
|
},
|
|
55
55
|
"volta": {
|
|
56
56
|
"node": "18.4.0"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { OnModuleDestroy } from "@nestjs/common";
|
|
2
|
-
import { RedisRedlockModuleOptions } from "./redis-redlock.interface";
|
|
3
|
-
import { ConfigurableModuleClass } from "./redis-redlock.module-definition";
|
|
4
|
-
export declare class RedisRedlockModule extends ConfigurableModuleClass implements OnModuleDestroy {
|
|
5
|
-
private readonly options;
|
|
6
|
-
constructor(options: RedisRedlockModuleOptions);
|
|
7
|
-
onModuleDestroy(): Promise<void>;
|
|
8
|
-
}
|