Sha256: 709165fc3523a2fb44ad50a04c0b35805e014bedcf7eda07712579e4a1d3218a

Contents?: true

Size: 748 Bytes

Versions: 2

Compression:

Stored size: 748 Bytes

Contents

require 'transaction/simple/threadsafe'

  # A transaction group is an object wrapper that manages a group of objects
  # as if they were a single object for the purpose of transaction
  # management. All transactions for this group of objects should be
  # performed against the transaction group object, not against individual
  # objects in the group. This is the threadsafe version of a transaction
  # group.
class Transaction::Simple::ThreadSafe::Group < Transaction::Simple::Group
  def initialize(*objects)
    @objects = objects || []
    @objects.freeze
    @objects.each { |obj| obj.extend(Transaction::Simple::ThreadSafe) }

    if block_given?
      begin
        yield self
      ensure
        self.clear
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
pdf-labels-1.0.0 vendor/transaction/simple/threadsafe/group.rb
transaction-simple-1.3.0 lib/transaction/simple/threadsafe/group.rb