eapache / channels

Golang channel helpers and special types

Home Page:https://godoc.org/github.com/eapache/channels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot resize to buffer capacity of None

eapache opened this issue · comments

Because there's a goroutine in the middle, the current ResizableChannel can't be resized to a capacity of None (for fully unbuffered blocking mode). The best it can do is a buffer of size 1.

I played around with a structure that returns different backing channels from In() and Out() depending on the current buffer size, but it turned out to be hard (potentially impossible) to preserve the order of elements coming out of the output channel(s) correctly.

It may be that this problem is just impossible, but leaving the ticket for documentation and in case anyone has a brilliant idea in this regard.