Skip to content

Commit

Permalink
Merge pull request #50 from felanios/feature/customized-lock-key
Browse files Browse the repository at this point in the history
fix: fixed typo in read me
  • Loading branch information
ledmago authored Jun 9, 2024
2 parents b9e0c25 + 55a6bc0 commit bfc4567
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ import { MurLockModule } from 'murlock';
})
export class AppModule {}
```
```typescript
import { MurLock } from 'murlock';

@Injectable()
export class AppService {
@MurLock(5000, 'someCustomKey', 'userId')
async someFunction(userId): Promise<void> {
// Some critical section that only one request should be able to execute at a time
}
}
```

### Ignoring Unlock Failures

Expand All @@ -160,18 +171,6 @@ MurLockModule.forRoot({
}),
```

```typescript
import { MurLock } from 'murlock';

@Injectable()
export class AppService {
@MurLock(5000, 'someCustomKey', 'userId')
async someFunction(userId): Promise<void> {
// Some critical section that only one request should be able to execute at a time
}
}
```

If we assume userId as 65782628 Lockey here will be someCustomKey:65782628

## Using `MurLockService` Directly
Expand Down

0 comments on commit bfc4567

Please sign in to comment.