Module: Falcon::Environment::Server
- Includes:
- Async::Service::ManagedEnvironment
- 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
-
#authority ⇒ Object
The server authority.
-
#cache ⇒ Object
Whether to enable the HTTP cache for this server.
-
#client_endpoint ⇒ Object
A client endpoint that can be used to connect to the server.
-
#endpoint ⇒ Object
The upstream endpoint that will handle incoming requests.
-
#endpoint_options ⇒ Object
Options to use when creating the endpoint.
-
#make_server(endpoint) ⇒ Object
Make a server instance using the given endpoint.
-
#service_class ⇒ Object
The service class to use for the proxy.
-
#timeout ⇒ Object
The timeout used for client connections.
-
#url ⇒ Object
The host that this server will receive connections for.
-
#verbose ⇒ Object
Whether to enable verbose logging.
Instance Method Details
#authority ⇒ Object
The server authority. Defaults to the server name.
26 27 28 |
# File 'lib/falcon/environment/server.rb', line 26 def self.name end |
#cache ⇒ Object
Whether to enable the HTTP cache for this server.
60 61 62 |
# File 'lib/falcon/environment/server.rb', line 60 def cache false end |
#client_endpoint ⇒ Object
A client endpoint that can be used to connect to the server.
66 67 68 |
# File 'lib/falcon/environment/server.rb', line 66 def client_endpoint ::Async::HTTP::Endpoint.parse(url) end |
#endpoint ⇒ Object
The upstream endpoint that will handle incoming requests.
50 51 52 |
# File 'lib/falcon/environment/server.rb', line 50 def endpoint ::Async::HTTP::Endpoint.parse(url).with(**) end |
#endpoint_options ⇒ Object
Options to use when creating the endpoint.
41 42 43 44 45 46 |
# File 'lib/falcon/environment/server.rb', line 41 def { reuse_address: true, timeout: self.timeout, } end |
#make_server(endpoint) ⇒ Object
Make a server instance using the given endpoint. The endpoint may be a bound endpoint, so we take care to specify the protocol and scheme as per the original endpoint.
74 75 76 |
# File 'lib/falcon/environment/server.rb', line 74 def make_server(endpoint) Falcon::Server.new(self.middleware, endpoint, protocol: self.endpoint.protocol, scheme: self.endpoint.scheme) end |
#service_class ⇒ Object
The service class to use for the proxy.
20 21 22 |
# File 'lib/falcon/environment/server.rb', line 20 def service_class Service::Server end |
#timeout ⇒ Object
The timeout used for client connections.
36 37 38 |
# File 'lib/falcon/environment/server.rb', line 36 def timeout nil end |
#url ⇒ Object
The host that this server will receive connections for.
31 32 33 |
# File 'lib/falcon/environment/server.rb', line 31 def url "http://[::]:9292" end |
#verbose ⇒ Object
Whether to enable verbose logging.
55 56 57 |
# File 'lib/falcon/environment/server.rb', line 55 def verbose false end |