{"id":18542726,"url":"https://github.com/coinbase/master_lock","last_synced_at":"2025-08-21T15:32:42.372Z","repository":{"id":48472488,"uuid":"69753370","full_name":"coinbase/master_lock","owner":"coinbase","description":"Inter-process locking library using Redis.","archived":false,"fork":false,"pushed_at":"2021-07-24T02:28:33.000Z","size":60,"stargazers_count":36,"open_issues_count":1,"forks_count":10,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-07-28T02:59:06.356Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coinbase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-01T17:39:49.000Z","updated_at":"2025-04-26T14:30:45.000Z","dependencies_parsed_at":"2022-08-20T22:31:01.353Z","dependency_job_id":null,"html_url":"https://github.com/coinbase/master_lock","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/coinbase/master_lock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmaster_lock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmaster_lock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmaster_lock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmaster_lock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coinbase","download_url":"https://codeload.github.com/coinbase/master_lock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fmaster_lock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271500361,"owners_count":24770375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T20:10:04.779Z","updated_at":"2025-08-21T15:32:42.104Z","avatar_url":"https://github.com/coinbase.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MasterLock\n\n[![Build Status](https://travis-ci.org/coinbase/master_lock.svg?branch=master)](https://travis-ci.org/coinbase/master_lock)\n[![Coverage Status](https://coveralls.io/repos/github/coinbase/master_lock/badge.svg?branch=master)](https://coveralls.io/github/coinbase/master_lock?branch=master)\n[![Gem Version](https://badge.fury.io/rb/master_lock.svg)](https://badge.fury.io/rb/master_lock)\n\nMasterLock is a Ruby library for interprocess locking using Redis. Critical sections of code can be wrapped in a MasterLock block that ensures only one thread will run the code at a time. The locks are resilient to process failures by expiring after the thread obtaining them dies.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'master_lock'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install master_lock\n\n## Usage\n\n```ruby\ndef perform_safe_operation\n  MasterLock.synchronize(\"perform_safe_operation\") do\n    # Code executes within locked context\n  end\nend\n\n# Call MasterLock.start when your application boots up.\n# This starts a background thread to prevent locks from expiring.\nMasterLock.start\n```\n\nSee [documentation](http://www.rubydoc.info/gems/master_lock) for advanced usage.\n\n## Development\n\nAfter checking out the repo, run `bundle install` to install the gem dependencies. \n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n### Testing\nIf you do not have Redis set up, run `brew install redis`. This gives you access to `redis-server`.\n\nTo set up the redis instance, run `redis-server` in the project level directory. The default config should be located at `/usr/local/etc/redis.conf`.\n\nTo set up the redis cluster, copy your redis-server executable to `cluster-test/redis-server`. Open up 6 terminal tabs, and in every tab, start every instance:\n```\ncd cluster-test/7000\n../redis-server ./redis.conf\n```\nAssuming you have at least Redis 5, create your cluster by running the following:\n```\nredis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 \\\n127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 \\\n--cluster-replicas 1\n```\n\nThen, run `rake spec` to run the tests. \n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/coinbase/master_lock.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fmaster_lock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoinbase%2Fmaster_lock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fmaster_lock/lists"}