solidus
https://github.com/solidusio/solidus
Ruby
🛒 Solidus, the open-source eCommerce framework for industry trailblazers.
Spree::OrderMutex.with_lock!
Obtain a lock on an order, execute the supplied block and then release the lock. Raise a LockFailed exception immediately if we cannot obtain the lock. We raise instead of blocking to avoid tying up multiple server processes waiting for the lock.
Edit
git clone [email protected]:solidusio/solidus.git
cd solidus
open core/app/models/spree/order_mutex.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Spree--OrderMutex-with_lock--for-pr
# Commit to gitgit add core/app/models/spree/order_mutex.rbgit commit -m "better docs for Spree::OrderMutex.with_lock!"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Spree--OrderMutex-with_lock--for-pr
hub pull-request
# Celebrate!