code comments, ensure dereferencer worker pool gets started

This commit is contained in:
kim 2024-04-24 13:09:06 +01:00
parent 216ddc6214
commit 2f859ec051
2 changed files with 11 additions and 4 deletions

View file

@ -37,16 +37,20 @@ type Workers struct {
// indexed queue of Delivery{} objects.
Delivery delivery.WorkerPool
// Client ...
// Client provides a worker pool that handles
// incoming processing jobs from the client API.
Client MsgWorkerPool[*messages.FromClientAPI]
// Federator ...
// Federator provides a worker pool that handles
// incoming processing jobs from the fedi API.
Federator MsgWorkerPool[*messages.FromFediAPI]
// Dereferencer worker pools.
// Dereference provides a worker pool
// for asynchronous dereferencer jobs.
Dereference FnWorkerPool
// Media manager worker pools.
// Media provides a worker pool for
// asynchronous media processing jobs.
Media FnWorkerPool
// prevent pass-by-value.

View file

@ -49,6 +49,7 @@ func StartNoopWorkers(state *state.State) {
_ = state.Workers.Scheduler.Start()
_ = state.Workers.Client.Start(1)
_ = state.Workers.Federator.Start(1)
_ = state.Workers.Dereference.Start(1)
_ = state.Workers.Media.Start(1)
}
@ -65,6 +66,7 @@ func StartWorkers(state *state.State, processor *workers.Processor) {
_ = state.Workers.Scheduler.Start()
_ = state.Workers.Client.Start(1)
_ = state.Workers.Federator.Start(1)
_ = state.Workers.Dereference.Start(1)
_ = state.Workers.Media.Start(1)
}
@ -72,6 +74,7 @@ func StopWorkers(state *state.State) {
_ = state.Workers.Scheduler.Stop()
_ = state.Workers.Client.Stop()
_ = state.Workers.Federator.Stop()
_ = state.Workers.Dereference.Stop()
_ = state.Workers.Media.Stop()
}