Sha256: d48f8506711aea9d63cfaff2e97f27ff68edc2a84bfc58e44e551509b4ad2f72

Contents?: true

Size: 314 Bytes

Versions: 2

Compression:

Stored size: 314 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/daemon_runner'
require 'dev/consul'

@service = 'myreleaseservice'
@lock_count = 3
@locked = false
@lock_time = 10

DaemonRunner::Semaphore.lock(@service, @lock_count) do
  @lock_time.downto(0).each do |i|
   puts "Releasing lock in #{i} seconds"
   sleep 1
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
daemon_runner-0.4.1 examples/example_semaphore_release.rb
daemon_runner-0.4.0 examples/example_semaphore_release.rb