Skip to content

jiacai2050/prosumer

Repository files navigation

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