Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResearchAgent ¶
type ResearchAgent struct { Errors <-chan error Done <-chan struct{} }
A ResearchAgent is responsible for gathering a pending work item from the pending work queue, spawning an Analyst sub-process, communicating with that process, and reporting completed research results back to the completed work queue.
func StartResearchAgent ¶
func StartResearchAgent(ctx context.Context, pendingResearchQueue messagebus.Receiver, completedWorkQueue messagebus.Sender, analyzer analyst.Analyzer) *ResearchAgent
StartResearchAgent initializes a research agent. The agent will attempt to consume a pending work item from the pending work queue. If there is no work found on the queue, the agent will exit. Otherwise, the agent will spawn an Analyst process, and assign the work to that process. As the Analyst completes its work, it is reported back to the Agent, who then forwards the results to the completed work queue.