Sha256: 30212c3be44a9cf3943e202e73688011ac402231353b4e339d7af25a8cb112f9

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

module Rinda # dirty monkey patching to retrieve unique running ID, primitiv einc beacuse touble nested tuplebag storage with symbols. 
  class TupleSpace
   
     def initialize(period=60)
      super()
      @bag = TupleBag.new
      @read_waiter = TupleBag.new
      @take_waiter = TupleBag.new
      @notify_waiter = TupleBag.new
      @period = period
      @keeper = nil
       @id = 0
    end
    
    
    def writeID(tuple,sec=nil)
      synchronize do
        @id =@id+1
        tuple["id"] = @id
        write(tuple,sec)
        @id
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dm-rinda-adapter-0.1.0 lib/rinda-patch.rb