Sha256: def83947bd26fc2797fce8931acdcd3587c459712a25a75aa0af80ace3526fbe
Contents?: true
Size: 1.34 KB
Versions: 1
Compression:
Stored size: 1.34 KB
Contents
# frozen_string_literal: true require_relative "config" require_relative "logging_helpers" require_relative "signal_manager" require "frankenstein/ruby_gc_metrics" require "frankenstein/ruby_vm_metrics" require "frankenstein/process_metrics" require "frankenstein/server" require "prometheus/client/registry" require "sigdump" require "ultravisor" module ServiceSkeleton class Runner include ServiceSkeleton::LoggingHelpers def initialize(klass, env) @config = (klass.config_class || ServiceSkeleton::Config).new(env, klass.service_name, klass.registered_variables) @logger = @config.logger @metrics_registry = Prometheus::Client::Registry.new @ultravisor = ServiceSkeleton.generate( config: @config, metrics_registry: @metrics_registry, service_metrics: klass.registered_metrics, service_signal_handlers: { klass.service_name.to_sym => klass.registered_signal_handlers } ) klass.register_ultravisor_children(@ultravisor, config: @config, metrics_registry: @metrics_registry) end def run @config.pre_run_logger.info(logloc) { "Starting service #{@config.service_name}" } @config.pre_run_logger.info(logloc) { (["Environment:"] + @config.env.map { |k, v| "#{k}=#{v.inspect}" }).join("\n ") } @ultravisor.run end private attr_reader :logger end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
service_skeleton-1.0.3 | lib/service_skeleton/runner.rb |