Class: MCPClient::Auth::BrowserOAuth::CallbackServer
- Inherits:
-
Object
- Object
- MCPClient::Auth::BrowserOAuth::CallbackServer
- Defined in:
- lib/mcp_client/auth/browser_oauth.rb
Overview
Wrapper class for TCPServer to provide shutdown interface
Instance Method Summary collapse
-
#initialize(tcp_server, thread, stop_callback) ⇒ CallbackServer
constructor
A new instance of CallbackServer.
- #shutdown ⇒ Object
Constructor Details
#initialize(tcp_server, thread, stop_callback) ⇒ CallbackServer
405 406 407 408 409 |
# File 'lib/mcp_client/auth/browser_oauth.rb', line 405 def initialize(tcp_server, thread, stop_callback) @tcp_server = tcp_server @thread = thread @stop_callback = stop_callback end |
Instance Method Details
#shutdown ⇒ Object
411 412 413 414 415 416 417 418 419 420 |
# File 'lib/mcp_client/auth/browser_oauth.rb', line 411 def shutdown # Signal the thread to stop @stop_callback&.call # Close the server socket @tcp_server&.close # Wait for thread to finish (with timeout) @thread&.join(2) end |