researcher

package
v0.0.0-...-4aa7239 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2021 License: OSL-3.0 Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL