BufferWithCount returns an Observable that emits buffers of items it collects from the source Observable. The resulting Observable emits buffers every skip items, each containing a slice of count items. When the source Observable completes or encounters an error, the resulting Observable emits the c
(count int, opts ...Option)
| 398 | // the resulting Observable emits the current buffer and propagates |
| 399 | // the notification from the source Observable. |
| 400 | func (o *ObservableImpl) BufferWithCount(count int, opts ...Option) Observable { |
| 401 | if count <= 0 { |
| 402 | return Thrown(IllegalInputError{error: "count must be positive"}) |
| 403 | } |
| 404 | |
| 405 | return observable(o.parent, o, func() operator { |
| 406 | return &bufferWithCountOperator{ |
| 407 | count: count, |
| 408 | buffer: make([]interface{}, count), |
| 409 | } |
| 410 | }, true, false, opts...) |
| 411 | } |
| 412 | |
| 413 | type bufferWithCountOperator struct { |
| 414 | count int |
nothing calls this directly
no test coverage detected