Socket
Socket
Sign inDemoInstall

github.com/dc0d/workerpool

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/dc0d/workerpool

Package workerpool provides a workerpool. It also can expand and shrink dynamically. Jobs can be queued using the Queue() method which also accepts a timeout parameter for timing out queuing and if all workers are too busy. For expanding the queue, Expand() method can be used, which increases the number of workers. If a timeout is provided, these extra workers will stop, if there are not enough jobs to do. It is also possible to explicitly stop extra workers by providing a quit channel.


Version published

Readme

Source

workerpool

License MIT GoDoc Go Report Card Build Status codecov

Get the package using:

$ go get -u -v -tags v3 github.com/dc0d/workerpool
  • No longer uses the context.Context pattern,
  • Channels removed from the API and replaced by simple function calls,

Previous version:

$ go get -u -v gopkg.in/dc0d/workerpool.v2

This is an implementation of a workerpool which can get expanded & shrink dynamically. Workers can get added when needed and get dismissed when no longer are needed. Of-course this workerpool can be used just as a simple one with a fixed size.

Examples can be seen inside documents.

FAQs

Last updated on 12 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc