Skip to content

Commit 862fb98

Browse files
authored
Update README.md - new params for example of using() (#303)
the readme as it was made me think that senderId and recipientId were something specific to the redlock algorithm that I needed to know, instead they are just generic identifiers, so in a generic example I think it's better to use something generic like "foo" or "a" etc.
1 parent 8b6e834 commit 862fb98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ The `using` method wraps and executes a routine in the context of an auto-extend
6767
The first parameter is an array of resources to lock; the second is the requested lock duration in milliseconds, which MUST NOT contain values after the decimal.
6868

6969
```ts
70-
await redlock.using([senderId, recipientId], 5000, async (signal) => {
70+
await redlock.using(["foo", "bar"], 5000, async (signal) => {
7171
// Do something...
72-
await something();
72+
await something("foo");
7373

7474
// Make sure any attempted lock extension has not failed.
7575
if (signal.aborted) {
@@ -79,7 +79,7 @@ await redlock.using([senderId, recipientId], 5000, async (signal) => {
7979
}
8080

8181
// Do something else...
82-
await somethingElse();
82+
await somethingElse("bar");
8383
});
8484
```
8585

0 commit comments

Comments
 (0)