Sha256: d9001e3514e035edde5475aba9a39d43dae0f6d2fac59200609761d2458cc64d

Contents?: true

Size: 674 Bytes

Versions: 12

Compression:

Stored size: 674 Bytes

Contents

God.watch do |w|
  w.name = 'degrading-lambda'
  w.start = 'ruby ' + File.join(File.dirname(__FILE__), *%w[tcp_server.rb])
  w.interval = 5
  w.grace = 2
  w.group = 'test'

  w.start_if do |start|
    start.condition(:process_running) do |c|
      c.running = false
    end
  end

  w.restart_if do |restart|
    restart.condition(:degrading_lambda) do |c|
      require 'socket'
      c.lambda = lambda {
        begin
          sock = TCPSocket.open('127.0.0.1', 9090)
          sock.send "2\n", 0
          retval = sock.gets
          puts "Retval is #{retval}"
          sock.close
          retval
        rescue
          false
        end
      }
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
resurrected_god-0.14.0 test/configs/degrading_lambda/degrading_lambda.god
mcproc-2016.2.20 test/configs/degrading_lambda/degrading_lambda.god
god-0.13.7 test/configs/degrading_lambda/degrading_lambda.god
god-0.13.6 test/configs/degrading_lambda/degrading_lambda.god
god-0.13.5 test/configs/degrading_lambda/degrading_lambda.god
god-0.13.4 test/configs/degrading_lambda/degrading_lambda.god
god-0.13.3 test/configs/degrading_lambda/degrading_lambda.god
god-0.13.2 test/configs/degrading_lambda/degrading_lambda.god
god-0.13.1 test/configs/degrading_lambda/degrading_lambda.god
god-0.13.0 test/configs/degrading_lambda/degrading_lambda.god
god-0.12.1 test/configs/degrading_lambda/degrading_lambda.god
god-0.12.0 test/configs/degrading_lambda/degrading_lambda.god