Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Factories = make(map[string]ProviderFactory) WRONG_CONFIG_TYPE = errors.New("provider: wrong config type") PROVIDER_NOT_EXIST = errors.New("provider: provider type does not exist") BAD_PROVIDER_CONFIG = errors.New("provider: bad config for provider") )
Functions ¶
Types ¶
type Provider ¶
type Provider interface { // RequestWork tell the provider you are ready for new work RequestWork(int, chan job.Job) error // a provider must be able to confirm jobs as well job.JobConfirmer // WaitTime tells the manager how long to wait before checking for more work // target is given in terms of jobs per second WaitTime(target float64) time.Duration // Close tells the provider to gracefully close all of it's connections to the outside world Close() error Target() float64 config.Configer Name() string }
Provider requests work from a datasource, and passes it to the manager
type ProviderFactory ¶
type ProviderFactory func() Provider
ProviderFactory build and return a new provider
Directories ¶
Path | Synopsis |
---|---|
Package http provider allows for jobs to be manualy inserted into the manager though an http api.
|
Package http provider allows for jobs to be manualy inserted into the manager though an http api. |
Package redis contains a provider which supplies the manager with jobs stored in a redis list.
|
Package redis contains a provider which supplies the manager with jobs stored in a redis list. |
Click to show internal directories.
Click to hide internal directories.