Class: ThreeScale::Backend::Server::Falcon

Inherits:
Object
  • Object
show all
Extended by:
Utils
Defined in:
lib/3scale/backend/server/falcon.rb

Class Method Summary collapse

Methods included from Utils

argv_add

Class Method Details

.help(global_options, options, args) ⇒ Object



46
47
48
# File 'lib/3scale/backend/server/falcon.rb', line 46

def self.help(global_options, options, args)
  system('falcon --help')
end

.restart(global_options, options, args) ⇒ Object



29
30
31
32
# File 'lib/3scale/backend/server/falcon.rb', line 29

def self.restart(global_options, options, args)
  argv = ['falcon', 'supervisor']
  argv_add argv, true, 'restart'
end

.start(global_options, options, args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/3scale/backend/server/falcon.rb', line 7

def self.start(global_options, options, args)
  # Falcon does not support:
  # - options[:daemonize]
  # - options[:logfile]
  # - options[:errorfile]
  # - options[:pidfile]

  manifest = global_options[:manifest]
  return unless manifest

  argv = ['falcon']
  argv_add argv, true, '--bind', 'http://0.0.0.0'
  argv_add argv, options[:port], '--port', options[:port]

  # Starts the prometheus server if needed. Just once even when spanning
  # multiple workers.
  argv_add argv, true, '--preload', 'lib/3scale/prometheus_server.rb'

  server_model = manifest[:server_model]
  argv_add argv, true, '--count', server_model[:workers].to_s
end

.stats(global_options, options, args) ⇒ Object



42
43
44
# File 'lib/3scale/backend/server/falcon.rb', line 42

def self.stats(global_options, options, args)
  STDERR.puts 'Not implemented'
end

.status(global_options, options, args) ⇒ Object



38
39
40
# File 'lib/3scale/backend/server/falcon.rb', line 38

def self.status(global_options, options, args)
  STDERR.puts 'Not implemented'
end

.stop(global_options, options, args) ⇒ Object



34
35
36
# File 'lib/3scale/backend/server/falcon.rb', line 34

def self.stop(global_options, options, args)
  STDERR.puts 'Not implemented'
end