On Sat, Nov 14, 2020 at 8:34 PM Robert Engels <reng...@ix.netcom.com> wrote:
> That wasn’t my take on the OPs need. He said the consumer is very > expensive - implying to me they only want to process the latest. If > dropping the oldest is viable you might as well drop all old entries and > use the latest. > The O.P. wrote two days ago: > Thanks. I want the receiver always get the relately new vaule, I don't want the sender blocked and I either choose drop the current value or the first value of the channel. But I don't find a way to safely drop the first value from the channel. In other words, they want the consumer to always fetch, and process, the oldest available value. They want the producer(s) to always enqueue their value; even if doing so requires dropping the oldest value from the queue to make room for the new value. Whether that is sensible behavior, thus requiring something other than a simple Go channel, is not obvious given what the O.P. has written so far. -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD-KBQhYV1J3o4s%2Ba1JnpXDz%2BprG4g5N_KjKo1Cp7WHS%2Bg%40mail.gmail.com.