Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/raidancampbell/go-workpool

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/raidancampbell/go-workpool

  • v0.0.0-20200329052109-d435240925bb
  • Source
  • Go
  • Socket score

Version published
Created
Source

go-workpool

Go Report Card GoDoc

import github.com/raidancampbell/go-workpool

go-workpool provides a pool-of-work pattern, to synchronize events before passing them to an asynchronous/parallel processing pipeline.

For example, if you have 3 events:

  1. an account creation for account a
  2. an account update for account a
  3. an account update for account b

Events 1 and 3 can be processed simultaneously, while event 2 must wait until event 1 is complete.

Usage

A workpool is instantiated via workpool.New(). The workpool expects submitted work to implement the Work interface. This interface has a Key() function to return a string ("a" or "b" in the above example), and has a Do() function to perform whatever work is required. The workpool_test.go file contains some simple examples.

FAQs

Package last updated on 29 Mar 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc