Thanks Jason, that is absolutely beautiful. Ranging over channel wont work when the channel remains open (my case), but the "callback" pattern is really nice.
Much appreciated, Andi On Wednesday, February 8, 2023 at 2:38:28 AM UTC+1 Jason E. Aten wrote: > > I have the requirement of make sure that downstream processes all data > currently being sent. > > I usually have the client submit a Request struct the includes a new Done > channel. When the downstream goroutine > finishes processing a given Request r, they close the r.Done channel. The > client can wait or select on the r.Done channel to > know when processing is finished. > > -- 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/0a4c162d-2852-4283-8839-39a89f2d4dd3n%40googlegroups.com.