Class: Kward::Transport::Runtime
- Inherits:
-
Object
- Object
- Kward::Transport::Runtime
- Defined in:
- lib/kward/transport/runtime.rb
Overview
Builds the Kward runtime needed by foreground transport processes.
Instance Attribute Summary collapse
-
#manager ⇒ Object
readonly
Returns the value of attribute manager.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Runtime
constructor
A new instance of Runtime.
- #shutdown ⇒ Object
Constructor Details
#initialize(client:) ⇒ Runtime
Returns a new instance of Runtime.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/kward/transport/runtime.rb', line 14 def initialize(client:) @server = RPC::Server.new( input: StringIO.new, output: StringIO.new, error_output: $stderr, client: client ) @manager = Manager.new( registry: @server.session_manager.plugin_registry, gateway: lambda { |transport_id| Gateway.new(session_manager: @server.session_manager, transport_id: transport_id) }, plugin_chat_gateway: lambda { |transport_id| PluginChatGateway.new(runtime: @server.plugin_chat_manager.runtime, transport_id: transport_id) }, config_root: ConfigFiles.config_dir, config_provider: ->(transport_id) { ConfigFiles.transport_config(transport_id) } ) end |
Instance Attribute Details
#manager ⇒ Object (readonly)
Returns the value of attribute manager.
12 13 14 |
# File 'lib/kward/transport/runtime.rb', line 12 def manager @manager end |
Instance Method Details
#shutdown ⇒ Object
34 35 36 37 38 |
# File 'lib/kward/transport/runtime.rb', line 34 def shutdown @manager.shutdown @server.shutdown nil end |