Class: Coatepec::Worker::Server
- Inherits:
-
Object
- Object
- Coatepec::Worker::Server
- Defined in:
- lib/coatepec/worker/server.rb
Overview
The test worker's message loop: reads NDJSON requests from its parent
over Protocol, lazily boots Rails on first use, dispatches status/
spec_run, and writes back structured ok/error responses.
Instance Method Summary collapse
-
#initialize(project_root, input:, protocol_output:) ⇒ Server
constructor
A new instance of Server.
- #run ⇒ Object
Constructor Details
#initialize(project_root, input:, protocol_output:) ⇒ Server
Returns a new instance of Server.
9 10 11 12 13 |
# File 'lib/coatepec/worker/server.rb', line 9 def initialize(project_root, input:, protocol_output:) @protocol = Protocol.new(input: input, output: protocol_output) @runtime = RailsRuntime.new(project_root) @project_root = project_root end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/coatepec/worker/server.rb', line 15 def run loop do = @protocol.read break if .nil? handle() end end |