Class: Executors::Services

Inherits:
Object
  • Object
show all
Extended by:
YamlParser
Defined in:
lib/executors/services.rb

Overview

Executor services top-level point of entry.

Constant Summary collapse

@@executors =
{}

Constants included from YamlParser

YamlParser::YAML_COMMAND_UNITS_VALID, YamlParser::YAML_COMMMAND_COMMANDS_KEY, YamlParser::YAML_COMMMAND_COMMAND_KEY, YamlParser::YAML_COMMMAND_DELAY_KEY, YamlParser::YAML_COMMMAND_INITIAL_KEY, YamlParser::YAML_COMMMAND_UNITS_KEY, YamlParser::YAML_EXECUTOR_ID_KEY, YamlParser::YAML_EXECUTOR_SIZE_KEY, YamlParser::YAML_EXECUTOR_TYPES_REQUIRING_SIZE, YamlParser::YAML_EXECUTOR_TYPE_KEY, YamlParser::YAML_EXECUTOR_TYPE_VALID

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from YamlParser

load_yaml_string

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



9
10
11
# File 'lib/executors/services.rb', line 9

def logger
  @logger
end

Class Method Details

.get(id) ⇒ Object

Gets an executor with the specified identifer symbol.



13
14
15
# File 'lib/executors/services.rb', line 13

def get(id)
  @@executors[id]
end

.get_cached_executorObject

Returns a cached ExecutorService.



18
19
20
# File 'lib/executors/services.rb', line 18

def get_cached_executor()
  get_executor "cached"
end

.get_fixed_executor(size) ⇒ Object

Returns a fixed ExecutorService of the specified size.



23
24
25
# File 'lib/executors/services.rb', line 23

def get_fixed_executor(size)
  get_executor "fixed", size
end

.get_scheduled_executor(size) ⇒ Object

Returns a ScheduledExecutorService of the specified size.



28
29
30
# File 'lib/executors/services.rb', line 28

def get_scheduled_executor(size)
  get_executor "scheduled", size
end

.get_single_executorObject

Returns a single ExecutorService.



33
34
35
# File 'lib/executors/services.rb', line 33

def get_single_executor()
  get_executor "single"
end

.get_single_scheduled_executorObject

Returns a single ScheduledExecutorService.



38
39
40
# File 'lib/executors/services.rb', line 38

def get_single_scheduled_executor()
  get_executor "single_scheduled"
end

.set(id, executor) ⇒ Object

Sets an executor against the specified identifer symbol.



43
44
45
46
# File 'lib/executors/services.rb', line 43

def set(id, executor)
  id = id.to_sym unless id.is_a? Symbol
  @@executors[id] = executor
end