Skip to content

go-worker is a work queue to run tasks in go routines

License

Notifications You must be signed in to change notification settings

asabya/go-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-worker

go-worker is a work queue to run tasks in go routines

Install

go get -u github.com/Sab94/go-worker

Usage

Once the package is imported under the name gw, an instance of Manager can be created like so:

  manager := gw.NewManager(2)

It can then be used to dispatch works in a buffered workChannle

  work := Work{
    Name: "Example Work"
  }

  workChannle := manager.NewBufferedManager(5)
  workChannle <- work

or GoWork can be called to dispatch works

  work := Work{
    Name: "Example Work"
  }
  gw.GoWork(work)

Examples

Check out the example

Project52

It is one of my project 52.

Note: This project is inspired by https://github.com/aloknerurkar/task-runner

About

go-worker is a work queue to run tasks in go routines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages