taskpool

package
v0.0.0-...-a1f36d2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package taskpool wraps execution task pool and cancel task pool

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager contains execution pool and cancel pool

func (Manager) HasJob

func (m Manager) HasJob(jobID string) bool

HasJob returns if execution pool has specified job

func (Manager) ShutdownAndWait

func (m Manager) ShutdownAndWait(timeout time.Duration)

ShutdownAndWait wait and shutdown the task pool

func (Manager) Submit

func (m Manager) Submit(log log.T, jobID string, job task.Job) error

Submit submits the task to the execution pool

type T

type T interface {
	Submit(log log.T, jobID string, job task.Job) error
	ShutdownAndWait(timeout time.Duration)
	HasJob(jobID string) bool
}

T represents the interface for taskpool

func NewTaskPool

func NewTaskPool(log log.T, documentWorkersLimit int, cancelWaitDurationMillisecond time.Duration) T

NewTaskPool creates a new instance of Manager

Jump to

Keyboard shortcuts

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