0.0
No commit activity in last 3 years
No release in over 3 years
Trhead process that only executes if no other thread with the same lock file is running
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

LockedProcess

Build Status Coverage Status Code Climate Dependency Status Gem Version

Locked process is a way of executing a Thread but preventing the same Thread from being executed while the first one is still running.

Instalation

gem install 'locked_process'

Usage

require 'locked_process'

process = LockedProcess.new('/tmp/download_images.pid') do
  MyImageDownloader.new.download
end

process.execute # executes MyImageDownloader.new.download in a Thread

# if the process is still running
process.execute # raises LockedProcess::Error

Author

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature) Do not forget to write tests
  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