Class: RosettAi::Quorum::Dispatcher
- Inherits:
-
Object
- Object
- RosettAi::Quorum::Dispatcher
- Defined in:
- lib/rosett_ai/quorum/dispatcher.rb
Overview
Dispatches a prompt to multiple engine executors in parallel.
Uses Thread (not Ractor) because the anthropic gem and Net::HTTP are not Ractor-safe. Thread is sufficient for I/O-bound API calls.
Instance Method Summary collapse
-
#dispatch(prompt, executors) ⇒ Hash<String, Hash>
Dispatch a prompt to the given executors.
Instance Method Details
#dispatch(prompt, executors) ⇒ Hash<String, Hash>
Dispatch a prompt to the given executors.
18 19 20 21 |
# File 'lib/rosett_ai/quorum/dispatcher.rb', line 18 def dispatch(prompt, executors) threads = spawn_threads(prompt, executors) collect_thread_results(threads) end |