disk

package
v0.0.0-...-eaa370e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiskFactory

func DiskFactory() provider.Provider

DiskFactory create and return a disk provider

func NewLocker

func NewLocker() *locker

NewLocker return a new locker

Types

type Disk

type Disk struct {
	// contains filtered or unexported fields
}

Disk a provider that uses a bolt db on disk as it's repository of jobs

func (*Disk) Close

func (d *Disk) Close() error

Close gracefully shut down the provider

func (*Disk) ConfigStruct

func (d *Disk) ConfigStruct() interface{}

ConfigStruct

func (*Disk) ConfirmJob

func (d *Disk) ConfirmJob(j job.Job) error

ConfirmJob remove the job from the temporary list

func (*Disk) Init

func (d *Disk) Init(i interface{}) error

Init set up the disk provider

func (*Disk) Name

func (d *Disk) Name() string

Name return the name of the provider

func (*Disk) RequestWork

func (d *Disk) RequestWork(n int, jobChan chan job.Job) error

RequestWork collect work from the database

func (*Disk) Target

func (d *Disk) Target() float64

Target return the target jobs per second for this provider

func (*Disk) WaitTime

func (d *Disk) WaitTime(target float64) time.Duration

WaitTime return how long to wait before asking for more work

type DiskConfig

type DiskConfig struct {
	Name   string  `json:"name" required:"true"`
	Target float64 `json:"target" required:"false"`
	DBName string  `json:"db_name" required:"false"`
	Bucket string  `json:"bucket" required:"true"`
}

DiskConfig the config struct used to set up the provider

type DiskJob

type DiskJob struct {
	// contains filtered or unexported fields
}

DiskJob a job that points back to a disk provider

func (*DiskJob) Config

func (d *DiskJob) Config() *job.JobConfig

Config return this jobs config

func (*DiskJob) JobConfirmer

func (d *DiskJob) JobConfirmer() job.JobConfirmer

JobConfirmer return the provider this job points back to

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL