Ruby Ep. 7: Concurrency and avoiding race conditions with Ruby on Rails

Ruby On Rails

Video is ready, Click Here to View ×


Shows how to use the ActiveRecord method ‘lock’ which uses ‘Select for update’ in order to ensure only one process can change a database value. We also illustrate how to test with concurrent processes.

The refreshably method can be found in the Atomic Jolt lti_starter_app project here: https://github.com/atomicjolt/lti_starter_app/blob/master/lib/canvas.rb.

Code for the breakpoints can be found here: http://eng.flipp.com/breakpoints-a-ruby-class-for-testing-race-conditions/

Leave a Reply

Your email address will not be published. Required fields are marked *