Documentation
¶
Index ¶
Constants ¶
View Source
const SIZE = 5 // size of cache
Variables ¶
View Source
var WorkerChannel = make(chan chan Work)
Functions ¶
func CreateExampleJobs ¶
CreateExampleJobs mimics the creation of 'amount' concurrent jobs.
func ExampleWork ¶
ExampleWork mimics any type of job that can be run concurrently
func RandStringRunes ¶
Types ¶
type Collector ¶
func StartDispatcher ¶
type JobSpec ¶
type JobSpec interface {
// Identifier is the main unique identifier associated
// with this specific job specification. It may be
// considered analogous to a primary key in a database.
Identifier() Any
// Name is an optional text name for this job that will
// be used in error messages and reports.
Name() string
// ID is an optional unique identifier for this job. It
// may be used when sorting and searching performance
// will be hindered by using an interface{}.
Id() int
// Completed tags the job specification as completed.
// Not all workers may have finished, but the goals of
// the job specification have been reached. All work is
// stopped and no further work will be performed.
Completed() bool
// Deadline is an optional time at which the job spec
// expires and no more work will be performed towards
// the goals of this job specification.
Deadline() time.Time
}
Click to show internal directories.
Click to hide internal directories.