Documentation
¶
Index ¶
Constants ¶
const ( // PollInterval is the fixed tick rate for both the Feeder and TaskScheduler. PollInterval = 500 * time.Millisecond // QueueWarnThreshold is the number of unprocessed messages that triggers a warning. QueueWarnThreshold = 20 // MaxRetries is the maximum number of times a message can be retried after failure. // Once retry_count reaches MaxRetries the message is permanently marked 'failed'. MaxRetries = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeeProcess ¶
type BeeProcess struct {
// contains filtered or unexported fields
}
BeeProcess wraps an EngineAdapter and injects a short-lived auth token into each Run call.
func NewBeeProcess ¶
func NewBeeProcess(cfg config.BeeConfig, engine ai.EngineAdapter) *BeeProcess
NewBeeProcess creates a BeeProcess.
func (*BeeProcess) ExtractResult ¶ added in v0.0.21
func (p *BeeProcess) ExtractResult(logPath string) string
func (*BeeProcess) Prepare ¶ added in v0.0.21
func (p *BeeProcess) Prepare(workDir string, opts ai.PrepareOptions) error
type FailureNotifier ¶
type FailureNotifier interface {
NotifyTaskFailure(ctx context.Context, messageID string, info model.FailureInfo) error
}
FailureNotifier sends a notification to the user when a message is permanently failed.
type Feeder ¶
type Feeder struct {
// contains filtered or unexported fields
}
Feeder polls platform_messages for unprocessed messages and feeds them to bee.
func NewFeeder ¶
func NewFeeder(ms *store.MessageStore, ts *store.TaskStore, ss *store.SessionStore, es *store.ExecutionStore, runner ai.EngineAdapter, workDir string, cfg config.BeeConfig, opts ...Option) *Feeder
NewFeeder creates a Feeder.
func (*Feeder) RecoverFeeding ¶
RecoverFeeding resets any messages stuck in 'feeding' status back to 'received' and deletes their associated pending tasks.
type Option ¶
type Option func(*Feeder)
Option configures a Feeder.
func WithFailureNotifier ¶
func WithFailureNotifier(n FailureNotifier) Option
WithFailureNotifier sets the notifier used to inform users when a message exhausts retries.
func WithWorkerDispatch ¶ added in v0.0.20
func WithWorkerDispatch(lookup *store.WorkerStore) Option
WithWorkerDispatch enables @mention direct dispatch by providing the worker lookup store.