Module: Transaction::Simple::ThreadSafe

Includes:
Transaction::Simple
Defined in:
lib/gems/transaction-simple-1.4.0/lib/transaction/simple/threadsafe.rb

Overview

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 Fernandez 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

Defined Under Namespace

Classes: Group

Constant Summary collapse

SKIP_TRANSACTION_VARS =

:nodoc:

Transaction::Simple::SKIP_TRANSACTION_VARS.dup

Constants included from Transaction::Simple

TRANSACTION_SIMPLE_VERSION

Method Summary

Methods included from Transaction::Simple

__common_start, #abort_transaction, #commit_transaction, debug_io, debug_io=, debugging?, #rewind_transaction, start, start_named, #start_transaction, #transaction, #transaction_exclusions, #transaction_name, #transaction_open?