Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandleWorkError ¶
func NewHandleWorkError ¶
func NewHandleWorkError(errorMessage string, workerID int, data []interface{}) HandleWorkError
func (HandleWorkError) Error ¶
func (hwe HandleWorkError) Error() string
type WorkConfiguration ¶
type WorkConfiguration struct {
Handler WorkHandler
MaxRetries int
Retriever WorkRetriever
}
type WorkHandler ¶
type WorkItem ¶
type WorkItem struct {
Data interface{}
Handler WorkHandler
}
type WorkItemCollection ¶
type WorkItemCollection []WorkItem
func (WorkItemCollection) Handle ¶
func (wic WorkItemCollection) Handle(workerID int, limiter ratelimit.Limiter, handler WorkHandler) error
type WorkRetriever ¶
type WorkRetriever interface {
RetrieveWork(handler WorkHandler) ([]WorkItem, error)
}
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func NewWorkerPool ¶
func NewWorkerPool(config WorkerPoolConfig) *WorkerPool
func (*WorkerPool) AddWorkConfiguration ¶
func (wp *WorkerPool) AddWorkConfiguration(config WorkConfiguration)
func (*WorkerPool) Run ¶
func (wp *WorkerPool) Run(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.