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

Add SugarUtils::File.flock_mutex #5

Open
acant opened this issue Apr 3, 2017 · 2 comments
Open

Add SugarUtils::File.flock_mutex #5

acant opened this issue Apr 3, 2017 · 2 comments

Comments

@acant
Copy link
Collaborator

acant commented Apr 3, 2017

Add this method which will use flock to ensure that the only one process can execute the given block at a time.

SugarUtils::File.flock_mutex(filename) do
  # code to run within the mutex
end
@acant
Copy link
Collaborator Author

acant commented Apr 3, 2017

There has been some discussion of the appropriate best practices for doing this:
https://www.ruby-forum.com/topic/77244

@acant
Copy link
Collaborator Author

acant commented Aug 26, 2017

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

No branches or pull requests

1 participant