Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create optional lock file for use of the data-store by external process #27

Closed
cblauvelt opened this issue Sep 9, 2019 · 7 comments
Closed

Comments

@cblauvelt
Copy link

I would like the option to create a lock file when the data-store is being synchronized. I understand this can cause slow-down so it would be off by default.

@cblauvelt
Copy link
Author

I am willing to provide a patch but wanted to know if you would be open to accepting it and if adding lockfile from https://github.com/npm/lockfile would be acceptable to implement.

@jonschlinkert
Copy link
Owner

You can use lockfiles in your own libraries to lock the version of data-store to whatever you want. However, for reasons that will take more time to explain than I have right now, we don't use lockfiles in our libraries. Lockfiles prevent semver from doing it's job, and our experience has been that - between semver and lockfiles - semver is the lesser of two evils.

@doowb
Copy link
Collaborator

doowb commented Sep 13, 2019

@jonschlinkert I don't think @cblauvelt was talking about a package lock file, but a lockfile to only allow a single process to access the file at a time.

@cblauvelt
Copy link
Author

@doowb I was a little confused bye the response and I was trying to figure out how semver would prevent another process from accessing the file while it was being written. @jonschlinkert I am trying to prevent an external process from reading the data-store while the file is being written and I am not trying to implement a package lock file such as that used by npm or yarn.

@jonschlinkert
Copy link
Owner

jonschlinkert commented Sep 13, 2019 via email

@jonschlinkert
Copy link
Owner

jonschlinkert commented Sep 13, 2019 via email

@cblauvelt
Copy link
Author

Exactly like a mutex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants