Documentation ¶
Overview ¶
Package workqueue provides a mechanism for keeping a queue of work to be done.
Index ¶
- type QueueAddCount
- type QueueAddFunc
- type QueueDoneFunc
- type WorkCounter
- type WorkQueue
- func (q *WorkQueue) AddTasks(tasks ...*task.Task)
- func (q *WorkQueue) GetAddCount() QueueAddCount
- func (q *WorkQueue) GetAddFunc() QueueAddFunc
- func (q *WorkQueue) GetCounter() *WorkCounter
- func (q *WorkQueue) GetDoneFunc() QueueDoneFunc
- func (q *WorkQueue) GetWorkChan() <-chan *task.Task
- func (q *WorkQueue) InputFinished()
- func (q *WorkQueue) Run()
- func (q *WorkQueue) RunInBackground()
- func (q *WorkQueue) SeedFromRobots(scope []*url.URL, clientFactory client.ClientFactory)
- func (q *WorkQueue) WaitPipe()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueueAddCount ¶
type QueueAddCount func(int)
type QueueAddFunc ¶
type QueueDoneFunc ¶
type QueueDoneFunc func(int)
type WorkCounter ¶
Count work to do and work done
func (*WorkCounter) Add ¶
func (ctr *WorkCounter) Add(todo int64)
Increment the count to be done (input)
func (*WorkCounter) Done ¶
func (ctr *WorkCounter) Done(done int64)
Increment the count that is done (output)
func (*WorkCounter) SetStatusCallback ¶
func (ctr *WorkCounter) SetStatusCallback(f func(int64, int64))
Set the status callback for this workcounter
type WorkQueue ¶
type WorkQueue struct {
// contains filtered or unexported fields
}
WorkQueue is a singleton that maintains the queue of work to be done. It reads from one input channel, verifies that the URL is in scope, queues it, then writes it to the work channel to be done. Internally, it implements a singly-linked list.
func NewWorkQueue ¶
func (*WorkQueue) GetAddCount ¶
func (q *WorkQueue) GetAddCount() QueueAddCount
func (*WorkQueue) GetAddFunc ¶
func (q *WorkQueue) GetAddFunc() QueueAddFunc
func (*WorkQueue) GetDoneFunc ¶
func (q *WorkQueue) GetDoneFunc() QueueDoneFunc
func (*WorkQueue) GetWorkChan ¶
func (*WorkQueue) InputFinished ¶
func (q *WorkQueue) InputFinished()
func (*WorkQueue) RunInBackground ¶
func (q *WorkQueue) RunInBackground()
func (*WorkQueue) SeedFromRobots ¶
func (q *WorkQueue) SeedFromRobots(scope []*url.URL, clientFactory client.ClientFactory)
Click to show internal directories.
Click to hide internal directories.