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 bundle.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 db.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(log logr.Logger, databaseURL string, statistics *statistics.Statistics) (*DBWorkerPool, error)
NewDBWorkerPool returns a new db workers pool dispatcher.
func (*DBWorkerPool) Acquire ¶
func (pool *DBWorkerPool) Acquire() *DBWorker
Acquire tries to acquire an available worker. if no worker is available, blocking until a worker becomes available.
func (*DBWorkerPool) Start ¶
func (pool *DBWorkerPool) Start() error
Start function starts the db workers pool.
func (*DBWorkerPool) Stop ¶
func (pool *DBWorkerPool) Stop()
Stop function stops the DBWorker queue.