Sha256: 0a9d54c6c387eca362f803187089dafee46448038742589f1f7d22c02b1942a4

Contents?: true

Size: 598 Bytes

Versions: 10

Compression:

Stored size: 598 Bytes

Contents

# frozen_string_literal: true

module ServiceSkeleton
  module UltravisorChildren
    def register_ultravisor_children(ultravisor, config:, metrics_registry:)
      begin
        ultravisor.add_child(
          id: self.service_name.to_sym,
          klass: self,
          method: :run,
          args: [config: config, metrics: metrics_registry],
          access: :unsafe
        )
      rescue Ultravisor::InvalidKAMError
        raise ServiceSkeleton::Error::InvalidServiceClassError,
              "Class #{self.to_s} does not implement the `run' instance method"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
service_skeleton-2.2.0 lib/service_skeleton/ultravisor_children.rb
service_skeleton-2.1.0 lib/service_skeleton/ultravisor_children.rb
service_skeleton-1.0.5 lib/service_skeleton/ultravisor_children.rb
service_skeleton-2.0.2 lib/service_skeleton/ultravisor_children.rb
service_skeleton-2.0.1 lib/service_skeleton/ultravisor_children.rb
service_skeleton-2.0.0 lib/service_skeleton/ultravisor_children.rb
service_skeleton-1.0.4 lib/service_skeleton/ultravisor_children.rb
service_skeleton-0.0.0.1.ENOTAG lib/service_skeleton/ultravisor_children.rb
service_skeleton-1.0.3 lib/service_skeleton/ultravisor_children.rb
service_skeleton-1.0.2 lib/service_skeleton/ultravisor_children.rb