Class: Concurrent::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/concurrent/configuration.rb

Overview

A gem-level configuration object.

Instance Method Summary (collapse)

Constructor Details

- (Configuration) initialize

Create a new configuration object.



179
180
# File 'lib/concurrent/configuration.rb', line 179

def initialize
end

Instance Method Details

- (Object) auto_terminate

Deprecated.

Use Concurrent.auto_terminate_global_executors? instead



260
261
262
263
# File 'lib/concurrent/configuration.rb', line 260

def auto_terminate
  deprecated_method 'Concurrent.configuration.auto_terminate', 'Concurrent.auto_terminate_global_executors?'
  Concurrent.auto_terminate_global_executors?
end

- (Object) auto_terminate=(value)

Deprecated.

Use Concurrent.disable_executor_auto_termination! instead



254
255
256
257
# File 'lib/concurrent/configuration.rb', line 254

def auto_terminate=(value)
  deprecated_method 'Concurrent.configuration.auto_terminate=', 'Concurrent.disable_executor_auto_termination!'
  Concurrent.disable_executor_auto_termination! if !value
end

- (Object) deprecated(message, strip = 2) Originally defined in module Concurrent::Concern::Deprecation

- (Object) deprecated_method(old_name, new_name) Originally defined in module Concurrent::Concern::Deprecation

- (Object) global_operation_pool

Deprecated.

Use Concurrent.global_fast_executor instead



214
215
216
217
# File 'lib/concurrent/configuration.rb', line 214

def global_operation_pool
  deprecated_method 'Concurrent.configuration.global_operation_pool', 'Concurrent.global_fast_executor'
  Concurrent.global_fast_executor
end

- (Object) global_operation_pool=(executor)

Deprecated.

Replacing global thread pools is deprecated. Use the :executor constructor option instead.



235
236
237
238
239
# File 'lib/concurrent/configuration.rb', line 235

def global_operation_pool=(executor)
  deprecated 'Replacing global thread pools is deprecated. Use the :executor constructor option instead.'
  GLOBAL_FAST_EXECUTOR.reconfigure { executor } or
      raise ConfigurationError.new('global operation pool was already set')
end

- (Object) global_task_pool

Deprecated.

Use Concurrent.global_io_executor instead



208
209
210
211
# File 'lib/concurrent/configuration.rb', line 208

def global_task_pool
  deprecated_method 'Concurrent.configuration.global_task_pool', 'Concurrent.global_io_executor'
  Concurrent.global_io_executor
end

- (Object) global_task_pool=(executor)

Deprecated.

Replacing global thread pools is deprecated. Use the :executor constructor option instead.



227
228
229
230
231
# File 'lib/concurrent/configuration.rb', line 227

def global_task_pool=(executor)
  deprecated 'Replacing global thread pools is deprecated. Use the :executor constructor option instead.'
  GLOBAL_IO_EXECUTOR.reconfigure { executor } or
      raise ConfigurationError.new('global task pool was already set')
end

- (Object) global_timer_set

Deprecated.

Use Concurrent.global_timer_set instead



220
221
222
223
# File 'lib/concurrent/configuration.rb', line 220

def global_timer_set
  deprecated_method 'Concurrent.configuration.global_timer_set', 'Concurrent.global_timer_set'
  Concurrent.global_timer_set
end

- (Object) log(level, progname, message = nil, &block) Originally defined in module Concurrent::Concern::Logging

Logs through Concurrent::Configuration#logger, it can be overridden by setting @logger

Parameters:

  • level (Integer)

    one of Logger::Severity constants

  • progname (String)

    e.g. a path of an Actor

  • message (String, nil) (defaults to: nil)

    when nil block is used to generate the message

Yield Returns:

  • (String)

    a message

- (Object) logger

Deprecated.

Use Concurrent.global_logger instead

a proc defining how to log messages, its interface has to be: lambda { |level, progname, message = nil, &block| _ }



193
194
195
196
# File 'lib/concurrent/configuration.rb', line 193

def logger
  deprecated_method 'Concurrent.configuration.logger', 'Concurrent.global_logger'
  Concurrent.global_logger.value
end

- (Object) logger=(value)

Deprecated.

Use Concurrent.global_logger instead

a proc defining how to log messages, its interface has to be: lambda { |level, progname, message = nil, &block| _ }



202
203
204
205
# File 'lib/concurrent/configuration.rb', line 202

def logger=(value)
  deprecated_method 'Concurrent.configuration.logger=', 'Concurrent.global_logger='
  Concurrent.global_logger = value
end

- (Object) new_operation_pool

Deprecated.

Use Concurrent.new_fast_executor instead



248
249
250
251
# File 'lib/concurrent/configuration.rb', line 248

def new_operation_pool
  deprecated_method 'Concurrent.configuration.new_operation_pool', 'Concurrent.new_fast_executor'
  Concurrent.new_fast_executor
end

- (Object) new_task_pool

Deprecated.

Use Concurrent.new_io_executor instead



242
243
244
245
# File 'lib/concurrent/configuration.rb', line 242

def new_task_pool
  deprecated_method 'Concurrent.configuration.new_task_pool', 'Concurrent.new_io_executor'
  Concurrent.new_io_executor
end

- (Object) no_logger

Deprecated.

Use Concurrent::NULL_LOGGER instead

if assigned to #logger, it will log nothing.



184
185
186
187
# File 'lib/concurrent/configuration.rb', line 184

def no_logger
  deprecated_method 'Concurrent.configuration.no_logger', 'Concurrent::NULL_LOGGER'
  NULL_LOGGER
end