Periodically subdivide items from an Observable into Observable windows and emit these windows rather than emitting the items one at a time.
WindowWithCount
WindowWithTime
WindowWithTimeOrCount
observe := rxgo.Just(1, 2, 3)().WindowWithCount(2).Observe()
fmt.Println("First Observable")
for item := range (<-observe).V.(rxgo.Observable).Observe() {
if item.Error() {
return item.E
}
fmt.Println(item.V)
}
fmt.Println("Second Observable")
for item := range (<-observe).V.(rxgo.Observable).Observe() {
if item.Error() {
return item.E
}
fmt.Println(item.V)
}
Output:
First Observable
1
2
Second Observable
3