littlemanco / the-golden-path.net

A template for writing a new tool or service.
0 stars 0 forks source link

Concurrency #36

Open andrewhowdencom opened 4 years ago

andrewhowdencom commented 4 years ago

Use buffered channels by default (prevents blocking until buffer is full)

Reject calls that sit outside the buffer (select {} with default) rather than block, defer to retries & back off.

Keep a gague of buffer max and current count.

Rel: https://dave.cheney.net/2013/04/30/curious-channels Rel: https://blog.acolyer.org/2019/05/17/understanding-real-world-concurrency-bugs-in-go/