Module Transaction::Simple::ThreadSafe
In: lib/transaction/simple/threadsafe.rb

Transaction::Simple::ThreadSafe

Thread-safe simple object transaction support for Ruby. Transaction::Simple::ThreadSafe is used in the same way as Transaction::Simple. Transaction::Simple::ThreadSafe uses a Mutex object to ensure atomicity at the cost of performance in threaded applications.

Transaction::Simple::ThreadSafe will not wait to obtain a lock; if the lock cannot be obtained immediately, a Transaction::TransactionThreadError will be raised.

Thanks to Mauricio Fernández for help with getting this part working.

Threadsafe transactions can be used in any place that normal transactions would. The main difference would be in setup:

  require 'transaction/simple/threadsafe'

  x = "Hello, you."
  x.extend(Transaction::Simple::ThreadSafe) # Threadsafe

  y = "Hello, you."
  y.extend(Transaction::Simple)             # Not threadsafe

Included Modules

Transaction::Simple

Classes and Modules

Class Transaction::Simple::ThreadSafe::Group

Constants

SKIP_TRANSACTION_VARS = Transaction::Simple::SKIP_TRANSACTION_VARS.dup #:nodoc:

[Validate]