Re: [go-nuts] concurent pipe

2018-12-04 Thread Burak Serdar
On Tue, Dec 4, 2018 at 11:57 AM Alex Dvoretskiy wrote: > > Hi Golangnuts, > > I'm trying to implement kind of pipe function, using channels > > Do you think this would be a correct conception: > > func Pipe(fs ...task) { > > ch1 := make(chan interface{}) > ch2 := make(chan interface{}) > > for _,

[go-nuts] concurent pipe

2018-12-04 Thread Alex Dvoretskiy
Hi Golangnuts, I'm trying to implement kind of pipe function, using channels Do you think this would be a correct conception: func Pipe(fs ...task) { ch1 := make(chan interface{}) ch2 := make(chan interface{}) for _, f := range fs { ch1, ch2 = ch2, ch1 go f(ch1, ch2) } } Can you also explai