Skip to content

Commit

Permalink
update(Zip*): do not buffer any value
Browse files Browse the repository at this point in the history
  • Loading branch information
b97tsk committed Mar 31, 2024
1 parent 93e013e commit fd3b147
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 60 deletions.
8 changes: 4 additions & 4 deletions zip2.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package rx
// Zip2 combines multiple Observables to create an Observable that emits
// mappings of the values emitted by each of its input Observables.
//
// Zip2 pulls values from each input Observable one by one, it only buffers
// one value for each input Observable.
// Zip2 pulls values from each input Observable one by one, it does not
// buffer any value.
func Zip2[T1, T2, R any](
obs1 Observable[T1],
obs2 Observable[T2],
Expand All @@ -18,8 +18,8 @@ func Zip2[T1, T2, R any](
close(noop)
})

chan1 := make(chan Notification[T1], 1)
chan2 := make(chan Notification[T2], 1)
chan1 := make(chan Notification[T1])
chan2 := make(chan Notification[T2])

c.Go(func() { obs1.Subscribe(c, channelObserver(chan1, noop)) })
c.Go(func() { obs2.Subscribe(c, channelObserver(chan2, noop)) })
Expand Down
10 changes: 5 additions & 5 deletions zip3.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package rx
// Zip3 combines multiple Observables to create an Observable that emits
// mappings of the values emitted by each of its input Observables.
//
// Zip3 pulls values from each input Observable one by one, it only buffers
// one value for each input Observable.
// Zip3 pulls values from each input Observable one by one, it does not
// buffer any value.
func Zip3[T1, T2, T3, R any](
obs1 Observable[T1],
obs2 Observable[T2],
Expand All @@ -19,9 +19,9 @@ func Zip3[T1, T2, T3, R any](
close(noop)
})

chan1 := make(chan Notification[T1], 1)
chan2 := make(chan Notification[T2], 1)
chan3 := make(chan Notification[T3], 1)
chan1 := make(chan Notification[T1])
chan2 := make(chan Notification[T2])
chan3 := make(chan Notification[T3])

c.Go(func() { obs1.Subscribe(c, channelObserver(chan1, noop)) })
c.Go(func() { obs2.Subscribe(c, channelObserver(chan2, noop)) })
Expand Down
12 changes: 6 additions & 6 deletions zip4.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package rx
// Zip4 combines multiple Observables to create an Observable that emits
// mappings of the values emitted by each of its input Observables.
//
// Zip4 pulls values from each input Observable one by one, it only buffers
// one value for each input Observable.
// Zip4 pulls values from each input Observable one by one, it does not
// buffer any value.
func Zip4[T1, T2, T3, T4, R any](
obs1 Observable[T1],
obs2 Observable[T2],
Expand All @@ -20,10 +20,10 @@ func Zip4[T1, T2, T3, T4, R any](
close(noop)
})

chan1 := make(chan Notification[T1], 1)
chan2 := make(chan Notification[T2], 1)
chan3 := make(chan Notification[T3], 1)
chan4 := make(chan Notification[T4], 1)
chan1 := make(chan Notification[T1])
chan2 := make(chan Notification[T2])
chan3 := make(chan Notification[T3])
chan4 := make(chan Notification[T4])

c.Go(func() { obs1.Subscribe(c, channelObserver(chan1, noop)) })
c.Go(func() { obs2.Subscribe(c, channelObserver(chan2, noop)) })
Expand Down
14 changes: 7 additions & 7 deletions zip5.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package rx
// Zip5 combines multiple Observables to create an Observable that emits
// mappings of the values emitted by each of its input Observables.
//
// Zip5 pulls values from each input Observable one by one, it only buffers
// one value for each input Observable.
// Zip5 pulls values from each input Observable one by one, it does not
// buffer any value.
func Zip5[T1, T2, T3, T4, T5, R any](
obs1 Observable[T1],
obs2 Observable[T2],
Expand All @@ -21,11 +21,11 @@ func Zip5[T1, T2, T3, T4, T5, R any](
close(noop)
})

chan1 := make(chan Notification[T1], 1)
chan2 := make(chan Notification[T2], 1)
chan3 := make(chan Notification[T3], 1)
chan4 := make(chan Notification[T4], 1)
chan5 := make(chan Notification[T5], 1)
chan1 := make(chan Notification[T1])
chan2 := make(chan Notification[T2])
chan3 := make(chan Notification[T3])
chan4 := make(chan Notification[T4])
chan5 := make(chan Notification[T5])

c.Go(func() { obs1.Subscribe(c, channelObserver(chan1, noop)) })
c.Go(func() { obs2.Subscribe(c, channelObserver(chan2, noop)) })
Expand Down
16 changes: 8 additions & 8 deletions zip6.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package rx
// Zip6 combines multiple Observables to create an Observable that emits
// mappings of the values emitted by each of its input Observables.
//
// Zip6 pulls values from each input Observable one by one, it only buffers
// one value for each input Observable.
// Zip6 pulls values from each input Observable one by one, it does not
// buffer any value.
func Zip6[T1, T2, T3, T4, T5, T6, R any](
obs1 Observable[T1],
obs2 Observable[T2],
Expand All @@ -22,12 +22,12 @@ func Zip6[T1, T2, T3, T4, T5, T6, R any](
close(noop)
})

chan1 := make(chan Notification[T1], 1)
chan2 := make(chan Notification[T2], 1)
chan3 := make(chan Notification[T3], 1)
chan4 := make(chan Notification[T4], 1)
chan5 := make(chan Notification[T5], 1)
chan6 := make(chan Notification[T6], 1)
chan1 := make(chan Notification[T1])
chan2 := make(chan Notification[T2])
chan3 := make(chan Notification[T3])
chan4 := make(chan Notification[T4])
chan5 := make(chan Notification[T5])
chan6 := make(chan Notification[T6])

c.Go(func() { obs1.Subscribe(c, channelObserver(chan1, noop)) })
c.Go(func() { obs2.Subscribe(c, channelObserver(chan2, noop)) })
Expand Down
18 changes: 9 additions & 9 deletions zip7.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package rx
// Zip7 combines multiple Observables to create an Observable that emits
// mappings of the values emitted by each of its input Observables.
//
// Zip7 pulls values from each input Observable one by one, it only buffers
// one value for each input Observable.
// Zip7 pulls values from each input Observable one by one, it does not
// buffer any value.
func Zip7[T1, T2, T3, T4, T5, T6, T7, R any](
obs1 Observable[T1],
obs2 Observable[T2],
Expand All @@ -23,13 +23,13 @@ func Zip7[T1, T2, T3, T4, T5, T6, T7, R any](
close(noop)
})

chan1 := make(chan Notification[T1], 1)
chan2 := make(chan Notification[T2], 1)
chan3 := make(chan Notification[T3], 1)
chan4 := make(chan Notification[T4], 1)
chan5 := make(chan Notification[T5], 1)
chan6 := make(chan Notification[T6], 1)
chan7 := make(chan Notification[T7], 1)
chan1 := make(chan Notification[T1])
chan2 := make(chan Notification[T2])
chan3 := make(chan Notification[T3])
chan4 := make(chan Notification[T4])
chan5 := make(chan Notification[T5])
chan6 := make(chan Notification[T6])
chan7 := make(chan Notification[T7])

c.Go(func() { obs1.Subscribe(c, channelObserver(chan1, noop)) })
c.Go(func() { obs2.Subscribe(c, channelObserver(chan2, noop)) })
Expand Down
20 changes: 10 additions & 10 deletions zip8.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package rx
// Zip8 combines multiple Observables to create an Observable that emits
// mappings of the values emitted by each of its input Observables.
//
// Zip8 pulls values from each input Observable one by one, it only buffers
// one value for each input Observable.
// Zip8 pulls values from each input Observable one by one, it does not
// buffer any value.
func Zip8[T1, T2, T3, T4, T5, T6, T7, T8, R any](
obs1 Observable[T1],
obs2 Observable[T2],
Expand All @@ -24,14 +24,14 @@ func Zip8[T1, T2, T3, T4, T5, T6, T7, T8, R any](
close(noop)
})

chan1 := make(chan Notification[T1], 1)
chan2 := make(chan Notification[T2], 1)
chan3 := make(chan Notification[T3], 1)
chan4 := make(chan Notification[T4], 1)
chan5 := make(chan Notification[T5], 1)
chan6 := make(chan Notification[T6], 1)
chan7 := make(chan Notification[T7], 1)
chan8 := make(chan Notification[T8], 1)
chan1 := make(chan Notification[T1])
chan2 := make(chan Notification[T2])
chan3 := make(chan Notification[T3])
chan4 := make(chan Notification[T4])
chan5 := make(chan Notification[T5])
chan6 := make(chan Notification[T6])
chan7 := make(chan Notification[T7])
chan8 := make(chan Notification[T8])

c.Go(func() { obs1.Subscribe(c, channelObserver(chan1, noop)) })
c.Go(func() { obs2.Subscribe(c, channelObserver(chan2, noop)) })
Expand Down
22 changes: 11 additions & 11 deletions zip9.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package rx
// Zip9 combines multiple Observables to create an Observable that emits
// mappings of the values emitted by each of its input Observables.
//
// Zip9 pulls values from each input Observable one by one, it only buffers
// one value for each input Observable.
// Zip9 pulls values from each input Observable one by one, it does not
// buffer any value.
func Zip9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](
obs1 Observable[T1],
obs2 Observable[T2],
Expand All @@ -25,15 +25,15 @@ func Zip9[T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](
close(noop)
})

chan1 := make(chan Notification[T1], 1)
chan2 := make(chan Notification[T2], 1)
chan3 := make(chan Notification[T3], 1)
chan4 := make(chan Notification[T4], 1)
chan5 := make(chan Notification[T5], 1)
chan6 := make(chan Notification[T6], 1)
chan7 := make(chan Notification[T7], 1)
chan8 := make(chan Notification[T8], 1)
chan9 := make(chan Notification[T9], 1)
chan1 := make(chan Notification[T1])
chan2 := make(chan Notification[T2])
chan3 := make(chan Notification[T3])
chan4 := make(chan Notification[T4])
chan5 := make(chan Notification[T5])
chan6 := make(chan Notification[T6])
chan7 := make(chan Notification[T7])
chan8 := make(chan Notification[T8])
chan9 := make(chan Notification[T9])

c.Go(func() { obs1.Subscribe(c, channelObserver(chan1, noop)) })
c.Go(func() { obs2.Subscribe(c, channelObserver(chan2, noop)) })
Expand Down

0 comments on commit fd3b147

Please sign in to comment.