Module: SemanticLogger::RactorSupport

Defined in:
lib/semantic_logger/ractor_support.rb

Overview

Internal, experimental: whether this Ruby can log from Ractors other than the main one (Ruby 4.0 and later), and whether the code running now is in such a Ractor. The rest of Semantic Logger asks this module rather than checking Ractor itself.

Class Method Summary collapse

Class Method Details

.enabled? ⇒ Boolean

Returns [false] since this Ruby cannot log from Ractors other than the main one.

Returns:

  • (Boolean)


8
9
10
# File 'lib/semantic_logger/ractor_support.rb', line 8

def self.enabled?
  true
end

.other_ractor? ⇒ Boolean

Returns [false] since every log call runs in the main Ractor.

Returns:

  • (Boolean)


13
14
15
# File 'lib/semantic_logger/ractor_support.rb', line 13

def self.other_ractor?
  !::Ractor.main?
end