Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBJob ¶
type DBJob struct {
// contains filtered or unexported fields
}
DBJob represents the job to be run by a DBWorker from the pool.
func NewDBJob ¶
func NewDBJob(bundle status.Bundle, metadata *conflator.BundleMetadata, handlerFunction conflator.BundleHandlerFunc, conflationUnitResultReporter conflator.ResultReporter, ) *DBJob
NewDBJob creates a new instance of DBJob.
type DBWorker ¶
type DBWorker struct {
// contains filtered or unexported fields
}
DBWorker worker within the DB Worker pool. runs as a goroutine and invokes DBJobs.
func NewDBWorker ¶
func NewDBWorker(log logr.Logger, workerID int32, dbWorkersPool chan *DBWorker, dbConnPool postgres.StatusTransportBridgeDB, statistics *statistics.Statistics, ) *DBWorker
NewDBWorker creates a new instance of DBWorker. jobsQueue is initialized with capacity of 1. this is done in order to make sure dispatcher isn't blocked when calling to RunAsync, otherwise it will yield cpu to other go routines.
type DBWorkerPool ¶
type DBWorkerPool struct {
// contains filtered or unexported fields
}
DBWorkerPool pool that registers all db workers and the assigns db jobs to available workers.
func NewDBWorkerPool ¶
func NewDBWorkerPool(dataConfig *config.DatabaseConfig, statistics *statistics.Statistics) (*DBWorkerPool, error)
NewDBWorkerPool returns a new db workers pool dispatcher.
func (*DBWorkerPool) Acquire ¶
func (pool *DBWorkerPool) Acquire() (*DBWorker, error)
Acquire tries to acquire an available worker. if no worker is available, blocking until a worker becomes available.