Sha256: 9b3fc35f2785fb8389c423b145bbe3b24d6bb2e07547d1047b939109d2de1647

Contents?: true

Size: 492 Bytes

Versions: 2

Compression:

Stored size: 492 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/cotcube-dataproxy'

Signal.trap('TERM') { local_interrupt }
Signal.trap('INT')  { local_interrupt }

# TODO: Prepare reload config on SIGHUP
Signal.trap('HUP')  { puts 'TODO: Reload config' }
exiting = false

dataproxy = Cotcube::DataProxy.new

define_method :local_interrupt do
  dataproxy.send(:log, "DATAPROXY Received termination request...")
  exiting = true
end


begin
  loop { exit if exiting; sleep 0.5 }
ensure
  dataproxy.shutdown
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cotcube-dataproxy-0.1.2 bin/dataproxy
cotcube-dataproxy-0.1.1 bin/dataproxy