Skip to content

Commit 506b35d

Browse files
committed
Update readme with bufferSplit example
1 parent 0020c2b commit 506b35d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RxJava 2.x implementation of extra sources, operators and components and ports o
1313

1414
```
1515
dependencies {
16-
compile "com.github.akarnokd:rxjava2-extensions:0.14.2"
16+
compile "com.github.akarnokd:rxjava2-extensions:0.14.3"
1717
}
1818
```
1919

@@ -641,6 +641,22 @@ Flowable.just("1", "2", "#", "3", "#", "4", "#")
641641
);
642642
```
643643

644+
### FlowableTransformers.bufferSplit
645+
646+
Buffers into a list/collection while the predicate returns false. When it returns true,
647+
a new buffer is started and the particular item won't be in any of the buffers.
648+
649+
```java
650+
Flowable.just("1", "2", "#", "3", "#", "4", "#")
651+
.compose(FlowableTransformers.bufferSplit(v -> "#".equals(v)))
652+
.test()
653+
.assertResult(
654+
Arrays.asList("1", "2"),
655+
Arrays.asList("3"),
656+
Arrays.asList("4")
657+
);
658+
```
659+
644660
### FlowableTransformers.spanout
645661

646662
Inserts a time delay between emissions from the upstream. For example, if the upstream emits 1, 2, 3 in a quick succession, a spanout(1, TimeUnit.SECONDS) will emit 1 immediately, 2 after a second and 3 after a second after 2. You can specify the initial delay, a custom scheduler and if an upstream error should be delayed after the normal items or not.

0 commit comments

Comments
 (0)