Skip to content

Add a warning about the non-guaranteed order #19

@gajus

Description

@gajus

The way that simple mutex is implemented means that there is no guarantee of the order, i.e.,

const say = async (word: string) => {
  const release = await lock(redis, 'say');
  console.log(word);
  await release();
}

Promise.all([
  say('a'),
  say('b'),
  say('c')
]);

There is no guarantee that the output of this will be a, b c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions