class Zold::SyncWallets

Synchronized collection of wallets

Public Class Methods

new(wallets, log: Log::NULL, dir: wallets.path) click to toggle source
Calls superclass method
# File lib/zold/sync_wallets.rb, line 37
def initialize(wallets, log: Log::NULL, dir: wallets.path)
  @wallets = wallets
  @log = log
  @dir = dir
  super(wallets)
end

Public Instance Methods

acq(id, exclusive: false) { |wallet| ... } click to toggle source
# File lib/zold/sync_wallets.rb, line 44
def acq(id, exclusive: false)
  @wallets.acq(id, exclusive: exclusive) do |wallet|
    Futex.new(wallet.path, log: @log, lock: File.join(@dir, "#{id}.lock")).open(exclusive) do
      yield wallet
    end
  end
end