Sha256: 5ca8874e4b92260b08a191b7312621cfdff0b5681083207c75269c59c29480f2

Contents?: true

Size: 682 Bytes

Versions: 3

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true
# Minimal sample configuration file for Pitchfork

# listen 2007 # by default Pitchfork listens on port 8080
worker_processes 4 # this should be >= nr_cpus
refork_after [50, 100, 1000]

service_thread = nil
service_shutdown = false

before_service_worker_ready do |server, service|
  service_thread = Thread.new do
    server.logger.info "Service: start"
    count = 1
    until service_shutdown
      server.logger.info "Service: ping count=#{count}"
      count += 1
      sleep 1
    end
  end
end

before_service_worker_exit do |server, service|
  server.logger.info "Service: shutting down"
  service_shutdown = true
  service_thread&.join(2)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pitchfork-0.16.0 examples/pitchfork.conf.service.rb
pitchfork-0.15.0 examples/pitchfork.conf.service.rb
pitchfork-0.14.0 examples/pitchfork.conf.service.rb