with_advisory_lock is a Ruby gem that provides a simple and thread-safe way to use PostgreSQL advisory locks within Ruby applications. It allows developers to wrap critical code sections with database-level locks to prevent race conditions across concurrent processes or threads. It’s especially useful in distributed systems, background job processing, or scheduled tasks where application-level mutexes aren't sufficient.

Features

  • Uses PostgreSQL advisory locks to ensure exclusive access
  • Thread-safe locking mechanism for Ruby apps
  • Simple DSL for wrapping code blocks with a lock
  • Supports timeouts and non-blocking lock acquisition
  • Compatible with ActiveRecord and Sidekiq
  • Prevents duplicate job execution or overlapping tasks

Project Samples

Project Activity

See All Activity >

Categories

SQL Clients

License

MIT License

Follow With Advisory Lock

With Advisory Lock Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of With Advisory Lock!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Ruby

Related Categories

Ruby SQL Clients

Registered

2025-06-16