Class: GlobalService
Instance Attribute Summary
Attributes inherited from Application
#cluster, #running
Instance Method Summary
collapse
Methods inherited from Application
#appswarmBaseDir, #config, #getApp, #getAppDataPath, #getAppDataPaths, #getAppDataWritePath, #getAppDir, getAppDir, #getAppId, #getAppName, #getService, #info, #log, #monitor, protect, provides, #provides?, providing, #providingAPIs, #quit, #quit?, requirements, requires, #retrieveConfig, #shortName, #startup, #warning, #withApp, #withAppFork
Constructor Details
#initialize(cluster, options, name) ⇒ GlobalService
Returns a new instance of GlobalService.
7
8
9
10
11
|
# File 'lib/appswarm/global_service.rb', line 7
def initialize(cluster,options,name)
super(cluster,options)
@name=name
provides(name)
end
|
Instance Method Details
#cron ⇒ Object
34
35
36
|
# File 'lib/appswarm/global_service.rb', line 34
def cron
end
|
#cronTime ⇒ Object
12
13
14
|
# File 'lib/appswarm/global_service.rb', line 12
def cronTime
@options[:cronTime]||10
end
|
#run ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/appswarm/global_service.rb', line 20
def run
loop do
begin
cron
rescue Object=>e
log e
log e.backtrace if e.is_a?(Exception)
end
sleep(cronTime)
end
end
|
#serviceID ⇒ Object
16
17
18
|
# File 'lib/appswarm/global_service.rb', line 16
def serviceID
GlobalServiceID.new(@name,self.class.to_s,providingAPIs)
end
|
#stop ⇒ Object
31
32
33
|
# File 'lib/appswarm/global_service.rb', line 31
def stop
end
|