Skip to content

Commit ba404c6

Browse files
committed
Introduce make_server environment configuration.
1 parent 7af0705 commit ba404c6

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/falcon/environment/server.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ def client_endpoint
8282
def preload
8383
[]
8484
end
85+
86+
# 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.
87+
def make_server(endpoint)
88+
Falcon::Server.new(self.middleware, endpoint, protocol: self.endpoint.protocol, scheme: self.endpoint.scheme)
89+
end
8590
end
8691
end
8792
end

lib/falcon/service/server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def setup(container)
5858
evaluator = @environment.evaluator
5959

6060
Async do |task|
61-
server = Falcon::Server.new(evaluator.middleware, @bound_endpoint, protocol: @endpoint.protocol, scheme: @endpoint.scheme)
61+
server = evaluator.make_server(@bound_endpoint)
6262

6363
server.run
6464

releases.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Releases
22

3+
## Unreleased
4+
5+
- Introduce {ruby Falcon::Environment::Server#make_server} which gives you full control over the server creation process.
6+
37
## v0.50.0
48

59
- Add {ruby Falcon::Environment::Server#endpoint_options} to allow configuration of the endpoint options more easily.

0 commit comments

Comments
 (0)