Class: ActionMCP::Server::ServerBase
- Inherits:
-
Object
- Object
- ActionMCP::Server::ServerBase
- Defined in:
- lib/action_mcp/server.rb
Overview
Custom server base class for PubSub functionality
Instance Method Summary collapse
-
#configure(config_path) ⇒ Object
Allow manual override of the configuration.
-
#initialize(config_path = nil) ⇒ ServerBase
constructor
A new instance of ServerBase.
- #pubsub ⇒ Object
-
#shutdown ⇒ Object
Gracefully shut down the server and its resources.
Constructor Details
#initialize(config_path = nil) ⇒ ServerBase
Returns a new instance of ServerBase.
50 51 52 |
# File 'lib/action_mcp/server.rb', line 50 def initialize(config_path = nil) @configuration = Configuration.new(config_path) end |
Instance Method Details
#configure(config_path) ⇒ Object
Allow manual override of the configuration
60 61 62 63 64 |
# File 'lib/action_mcp/server.rb', line 60 def configure(config_path) shutdown_pubsub if @pubsub @configuration = Configuration.new(config_path) @pubsub = nil # Reset pubsub so it will be recreated with new config end |
#pubsub ⇒ Object
54 55 56 |
# File 'lib/action_mcp/server.rb', line 54 def pubsub @pubsub ||= create_pubsub end |
#shutdown ⇒ Object
Gracefully shut down the server and its resources
67 68 69 |
# File 'lib/action_mcp/server.rb', line 67 def shutdown shutdown_pubsub end |