Module: Falcon::Environment::Server

Included in:
Application, Proxy, Redirect
Defined in:
lib/falcon/environment/server.rb

Overview

Provides an environment for hosting a web application that uses a Falcon server.

Instance Method Summary collapse

Instance Method Details

#authorityObject

The server authority. Defaults to the server name.



24
25
26
# File 'lib/falcon/environment/server.rb', line 24

def authority
	self.name
end

#cacheObject



55
56
57
# File 'lib/falcon/environment/server.rb', line 55

def cache
	false
end

#client_endpointObject



59
60
61
# File 'lib/falcon/environment/server.rb', line 59

def client_endpoint
	::Async::HTTP::Endpoint.parse(url)
end

#container_optionsObject

Options to use when creating the container.



29
30
31
# File 'lib/falcon/environment/server.rb', line 29

def container_options
	{restart: true}
end

#endpointObject

The upstream endpoint that will handle incoming requests.



44
45
46
47
48
49
# File 'lib/falcon/environment/server.rb', line 44

def endpoint
	::Async::HTTP::Endpoint.parse(url).with(
		reuse_address: true,
		timeout: timeout,
	)
end

#preloadObject

Any scripts to preload before starting the server.



64
65
66
# File 'lib/falcon/environment/server.rb', line 64

def preload
	[]
end

#service_classObject

The service class to use for the proxy.



18
19
20
# File 'lib/falcon/environment/server.rb', line 18

def service_class
	Service::Server
end

#timeoutObject



38
39
40
# File 'lib/falcon/environment/server.rb', line 38

def timeout
	nil
end

#urlObject

The host that this server will receive connections for.



34
35
36
# File 'lib/falcon/environment/server.rb', line 34

def url
	"http://[::]:9292"
end

#verboseObject



51
52
53
# File 'lib/falcon/environment/server.rb', line 51

def verbose
	false
end