Documentation
¶
Overview ¶
Package reactor provides functionality to manage and control the processing of seeds.
Index ¶
- Variables
- func Freeze()
- func GetStateTable() []string
- func GetStateTableItems() []*models.Item
- func MarkAsFinished(item *models.Item) error
- func ReceiveFeedback(item *models.Item) error
- func ReceiveInsert(item *models.Item) error
- func Start(maxTokens int, outputChan chan *models.Item) error
- func Stop()
Constants ¶
This section is empty.
Variables ¶
var ( // ErrReactorAlreadyInitialized is the error returned when the reactor is already initialized ErrReactorAlreadyInitialized = errors.New("reactor already initialized") // ErrReactorNotInitialized is the error returned when the reactor is not initialized ErrReactorNotInitialized = errors.New("reactor not initialized") // ErrReactorShuttingDown is the error returned when the reactor is shutting down ErrReactorShuttingDown = errors.New("reactor shutting down") // ErrReactorFrozen is the error returned when the reactor is frozen ErrReactorFrozen = errors.New("reactor frozen") // ErrFeedbackItemNotPresent is the error returned when an item was sent to the feedback channel but not found in the state table ErrFeedbackItemNotPresent = errors.New("feedback item not present in state table") // ErrReactorItemPresent is the error returned when a received item is already in the state table ErrReactorItemPresent = errors.New("item already present in reactor") // ErrFinisehdItemNotFound is the error returned when an item been marked as finished but not found in the state table ErrFinisehdItemNotFound = errors.New("markAsFinished item not present in state table") )
Functions ¶
func GetStateTable ¶
func GetStateTable() []string
GetStateTable returns a slice of all the seeds UUIDs as string in the state table.
func GetStateTableItems ¶
GetStateTableItems returns a slice of all the seeds in the state table.
func MarkAsFinished ¶
MarkAsFinished marks an item as finished and releases a token if found in the state table.
func ReceiveFeedback ¶
ReceiveFeedback sends an item to the feedback channel. If the item is not present on the state table it gets discarded
func ReceiveInsert ¶
ReceiveInsert sends an item to the input channel consuming a token. It is the responsibility of the sender to set either ItemSourceQueue or ItemSourceHQ, if not set seed will get forced ItemSourceInsert
Types ¶
This section is empty.