Class: RubynCode::IDE::Handlers::ShutdownHandler
- Inherits:
-
Object
- Object
- RubynCode::IDE::Handlers::ShutdownHandler
- Defined in:
- lib/rubyn_code/ide/handlers/shutdown_handler.rb
Overview
Handles the “shutdown” JSON-RPC request.
Triggers session persistence, signals the server to stop its read loop, and returns confirmation.
Instance Method Summary collapse
- #call(_params) ⇒ Object
-
#initialize(server) ⇒ ShutdownHandler
constructor
A new instance of ShutdownHandler.
Constructor Details
#initialize(server) ⇒ ShutdownHandler
Returns a new instance of ShutdownHandler.
11 12 13 |
# File 'lib/rubyn_code/ide/handlers/shutdown_handler.rb', line 11 def initialize(server) @server = server end |
Instance Method Details
#call(_params) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/rubyn_code/ide/handlers/shutdown_handler.rb', line 15 def call(_params) warn '[ShutdownHandler] shutdown requested' save_session! @server.stop! { 'shutdown' => true } end |