jiacai2050 / prosumer

A producer-consumer solution for Golang

Home Page:https://pkg.go.dev/github.com/jiacai2050/prosumer?tab=doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prosumer

GoDoc Build Status codecov

A producer-consumer solution for Golang.

Motivation

Go is popular for its simplicity, builtin support for concurrency, light-weight goroutine. However, there are some tricks(here and there) when to coordinate among different goroutines, especially when implements producer-consumer pattern using buffered chan.

I don't want cover details here, guys who interested can check links above. But following cannot be emphasized too much:

Close chan is a sender -> receiver communication, not the reverse. #11344

Feature

  • Inner buffer queue support RejectPolicy
  • Graceful close implemented

If you have any suggestions/questions, open a PR.

Usage

There is a quickstart example , view the GoDoc for details.

License

MIT License

About

A producer-consumer solution for Golang

https://pkg.go.dev/github.com/jiacai2050/prosumer?tab=doc

License:MIT License


Languages

Language:Go 97.1%Language:Makefile 2.9%