Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FnWorker ¶ added in v0.16.0
type FnWorker struct { // Queue is the fn queue that FnWorker // will feed from for upcoming tasks. Queue *queue.SimpleQueue[func(context.Context)] // contains filtered or unexported fields }
FnWorker wraps a queue.SimpleQueue{} which it feeds from to provide it with function tasks to execute. It does so in a single goroutine with state management utilities.
type FnWorkerPool ¶ added in v0.16.0
type FnWorkerPool struct { // Queue is embedded queue.SimpleQueue{} // passed to each of the pool Worker{}s. Queue queue.SimpleQueue[func(context.Context)] // contains filtered or unexported fields }
FnWorkerPool wraps multiple FnWorker{}s in a singular struct for easy multi start / stop.
func (*FnWorkerPool) Start ¶ added in v0.16.0
func (p *FnWorkerPool) Start(n int)
Start will attempt to start 'n' FnWorker{}s.
func (*FnWorkerPool) Stop ¶ added in v0.16.0
func (p *FnWorkerPool) Stop()
Stop will attempt to stop contained FnWorker{}s.
type MsgWorker ¶ added in v0.16.0
type MsgWorker[Msg any] struct { // Process handles queued message types. Process func(context.Context, Msg) error // Queue is the Delivery{} message queue // that delivery worker will feed from. Queue *queue.StructQueue[Msg] // contains filtered or unexported fields }
MsgWorker wraps a processing function to feed from a queue.StructQueue{} for messages to process. It does so in a single goroutine with state management utilities.
type MsgWorkerPool ¶ added in v0.16.0
type MsgWorkerPool[Msg any] struct { // Process handles queued message types. Process func(context.Context, Msg) error // Queue is embedded queue.StructQueue{} // passed to each of the pool Worker{}s. Queue queue.StructQueue[Msg] // contains filtered or unexported fields }
MsgWorkerPool wraps multiple MsgWorker{}s in a singular struct for easy multi start / stop.
func (*MsgWorkerPool[T]) Init ¶ added in v0.16.0
func (p *MsgWorkerPool[T]) Init(indices []structr.IndexConfig)
Init will initialize the worker pool queue with given struct indices.
func (*MsgWorkerPool[T]) Start ¶ added in v0.16.0
func (p *MsgWorkerPool[T]) Start(n int)
Start will attempt to start 'n' Worker{}s.
func (*MsgWorkerPool[T]) Stop ¶ added in v0.16.0
func (p *MsgWorkerPool[T]) Stop()
Stop will attempt to stop contained Worker{}s.
type Workers ¶
type Workers struct { // Main task scheduler instance. Scheduler scheduler.Scheduler // Delivery provides a worker pool that // handles outgoing ActivityPub deliveries. // It contains an embedded (but accessible) // indexed queue of Delivery{} objects. Delivery delivery.WorkerPool // Client provides a worker pool that handles // incoming processing jobs from the client API. Client MsgWorkerPool[*messages.FromClientAPI] // Federator provides a worker pool that handles // incoming processing jobs from the fedi API. Federator MsgWorkerPool[*messages.FromFediAPI] // Dereference provides a worker pool // for asynchronous dereferencer jobs. Dereference FnWorkerPool // Processing provides a worker pool // for asynchronous processing jobs, // eg., import tasks, admin tasks. Processing FnWorkerPool // contains filtered or unexported fields }
func (*Workers) StartScheduler ¶ added in v0.16.0
func (w *Workers) StartScheduler()
StartScheduler starts the job scheduler.