Class: Falcon::Command::Redirect

Inherits:
Samovar::Command
  • Object
show all
Includes:
Paths
Defined in:
lib/falcon/command/redirect.rb

Instance Method Summary collapse

Methods included from Paths

#configuration, #resolved_paths

Instance Method Details

#callObject



56
57
58
59
60
61
62
63
64
65
# File 'lib/falcon/command/redirect.rb', line 56

def call
	Async.logger.info(self) do |buffer|
		buffer.puts "Falcon Redirect v#{VERSION} taking flight!"
		buffer.puts "- Binding to: #{@options[:bind]}"
		buffer.puts "- To terminate: Ctrl-C or kill #{Process.pid}"
		buffer.puts "- To reload: kill -HUP #{Process.pid}"
	end
	
	self.controller.run
end

#container_classObject



48
49
50
# File 'lib/falcon/command/redirect.rb', line 48

def container_class
	Async::Container.best_container_class
end

#container_optionsObject



52
53
54
# File 'lib/falcon/command/redirect.rb', line 52

def container_options
	{}
end

#controllerObject



44
45
46
# File 'lib/falcon/command/redirect.rb', line 44

def controller
	Controller::Redirect.new(self)
end

#endpoint(**options) ⇒ Object



67
68
69
# File 'lib/falcon/command/redirect.rb', line 67

def endpoint(**options)
	Async::HTTP::Endpoint.parse(@options[:bind], timeout: @options[:timeout], **options)
end

#redirect_endpoint(**options) ⇒ Object



71
72
73
# File 'lib/falcon/command/redirect.rb', line 71

def redirect_endpoint(**options)
	Async::HTTP::Endpoint.parse(@options[:redirect], **options)
end