Class: Autoscale::Agent::Configuration
- Inherits:
-
Object
- Object
- Autoscale::Agent::Configuration
show all
- Defined in:
- lib/autoscale/agent/configuration.rb
Defined Under Namespace
Classes: BlockMissingError, InvalidPlatformError, PlatformMissingError
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Configuration.
10
11
12
|
# File 'lib/autoscale/agent/configuration.rb', line 10
def initialize(&block)
instance_eval(&block)
end
|
Instance Attribute Details
#web_dispatcher ⇒ Object
Returns the value of attribute web_dispatcher.
22
23
24
|
# File 'lib/autoscale/agent/configuration.rb', line 22
def web_dispatcher
@web_dispatcher
end
|
Instance Method Details
#dispatch(token, &block) ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/autoscale/agent/configuration.rb', line 32
def dispatch(token, &block)
if block
dispatch_worker(token, &block)
else
dispatch_web(token)
end
end
|
14
15
16
17
18
19
20
|
# File 'lib/autoscale/agent/configuration.rb', line 14
def platform(value = nil)
if value
@platform = validate_platform(value)
else
@platform || raise(PlatformMissingError)
end
end
|
#serve(token, &block) ⇒ Object
40
41
42
43
|
# File 'lib/autoscale/agent/configuration.rb', line 40
def serve(token, &block)
raise BlockMissingError, "missing block" unless block
worker_servers << WorkerServer.new(token, &block)
end
|
#worker_dispatchers ⇒ Object
24
25
26
|
# File 'lib/autoscale/agent/configuration.rb', line 24
def worker_dispatchers
@worker_dispatchers ||= WorkerDispatchers.new
end
|
#worker_servers ⇒ Object
28
29
30
|
# File 'lib/autoscale/agent/configuration.rb', line 28
def worker_servers
@worker_servers ||= WorkerServers.new
end
|