Class: Syntropy::HTTP::Server
- Inherits:
-
Object
- Object
- Syntropy::HTTP::Server
- Defined in:
- lib/syntropy/http/server.rb
Overview
HTTP::Server implements an HTTP server.
Constant Summary collapse
- PENDING_REQUESTS_GRACE_PERIOD =
0.1- PENDING_REQUESTS_TIMEOUT_PERIOD =
5
Instance Method Summary collapse
-
#initialize(machine, env, &app) ⇒ void
constructor
Initializes a server instance.
-
#run ⇒ void
Runs the server.
-
#stop! ⇒ void
Stops the server with graceful shutdown.
Constructor Details
#initialize(machine, env, &app) ⇒ void
Initializes a server instance.
18 19 20 21 22 23 24 |
# File 'lib/syntropy/http/server.rb', line 18 def initialize(machine, env, &app) @machine = machine @env = env @app = app @server_fds = [] @accept_fibers = [] end |
Instance Method Details
#run ⇒ void
This method returns an undefined value.
Runs the server.
29 30 31 32 33 34 |
# File 'lib/syntropy/http/server.rb', line 29 def run setup @machine.await(@accept_fibers) rescue UM::Terminate graceful_shutdown end |
#stop! ⇒ void
This method returns an undefined value.
Stops the server with graceful shutdown.
39 40 41 |
# File 'lib/syntropy/http/server.rb', line 39 def stop! graceful_shutdown end |