Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WorkQueue = make(chan model.WorkRequest, 100)
WorkQueue is the global queue of work to dispatch
View Source
var WorkerQueue chan chan model.WorkRequest
WorkerQueue is the global queue of Workers
Functions ¶
func ResolveScript ¶ added in v1.9.0
ResolveScript is resolving the target script.
func RetrieveLogFile ¶ added in v1.5.0
RetrieveLogFile retrieve work log with its name and id
func StartDispatcher ¶
func StartDispatcher(nworkers int)
StartDispatcher is charged to start n workers.
Types ¶
type ChanWriter ¶
type ChanWriter struct {
ByteChan chan []byte
}
ChanWriter is a simple writer to a channel of byte.
type Worker ¶
type Worker struct { ID int Work chan model.WorkRequest WorkerQueue chan chan model.WorkRequest QuitChan chan bool }
Worker is a go routine in charge of executing a work.
func NewWorker ¶
func NewWorker(id int, workerQueue chan chan model.WorkRequest) Worker
NewWorker creates, and returns a new Worker object.
Click to show internal directories.
Click to hide internal directories.