• Matthias Käppler's avatar
    Introduce `Runtime` class to identify runtime proc · 3a1ea22c
    Matthias Käppler authored
    This will serve as the new single access point into
    identifying which runtime is active.
    
    Add Process.max_threads method
    
    This will return the maximum concurrency for the given
    runtime environment.
    
    Revert to including `defined?` checks for Process
    
    This is based on a reference impl by new relic which they
    use to detect the current dispatcher.
    
    Add `name` method, throw if ambiguous
    
    This can be called from an initializer for instance.
    
    Log the current runtime in an initializer
    
    Add `multi_threaded?` and `app_server?` helpers
    
    To allow easier grouping of configuration
    
    Rename `Process` to `Runtime`
    
    And move it into its own file.
    
    Replace all remaining runtime checks with new API
    
    Including a commit body because the danger bot politely asked me
    to. There really is nothing else to say.
    
    Prefer `class << self` over `instance_eval`
    
    It seems to be the more widely adopted style.
    
    Simplify `has_instances?` helper method
    
    Fix rubocop offense
    
    Remove max_threads method
    
    This wasn't currently used anywhere and we should define this elsewhere.
    
    Remove references to NR library
    
    This caused some legal questions. We weren't using the instance lookup
    before, so it should be OK.
    3a1ea22c
runtime_spec.rb 2.71 KB