0.0
No commit activity in last 3 years
No release in over 3 years
Locks a method to a single process
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.5
~> 10
~> 2.3
 Project Readme

ProcessLock

Provides a process level synchronization context, allowing only a single process to execute a section of code any given time.

Windows is currently not supported.

Installation

Add this line to your application's Gemfile:

gem 'ProcessLock'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ProcessLock

Usage

Wrap any code you want to run in a synchronized context with

ProcessLock.ensure_only_process do
  # Your code here
end

Process lock will automatically infer a key based on the current file and method which is running. Optionally you can specify a your self ensure_only_process(:your_key_here)

Contributing

  1. Fork it ( http://github.com//ProcessLock/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request