job

package
v0.0.0-...-df740be Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job interface {
	Work()
}

Job job interface

type JobQueue

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

JobQueue job queue

func NewJobQueue

func NewJobQueue(maxWorker, bufferRate int) *JobQueue

NewJobQueue initialize a JobQueue and start it maxWorker max worker counts bufferRate queueSize = maxWorker * bufferRate

func (*JobQueue) Close

func (jobQueue *JobQueue) Close()

Close close this job queue

func (*JobQueue) Submit

func (jobQueue *JobQueue) Submit(job Job)

Submit submit job in queue

func (*JobQueue) SubmitTimeout

func (jobQueue *JobQueue) SubmitTimeout(job Job, timeout int) bool

SubmitTimeout submit job in queue with timeout in millisecond

Jump to

Keyboard shortcuts

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