feat: Add collectWhile operator. (#964)
This commit is contained in:
parent
11ba3d7bef
commit
19da73673d
13 changed files with 347 additions and 4 deletions
|
|
@ -401,6 +401,17 @@ class SourceOrFlow {
|
|||
// #collect
|
||||
}
|
||||
|
||||
void collectWhileExample() {
|
||||
// #collectWhile
|
||||
Flow<Message, Pong, NotUsed> flow =
|
||||
Flow.of(Message.class)
|
||||
.collectWhile(
|
||||
PFBuilder.<Message, Pong>create()
|
||||
.match(Ping.class, p -> p.id <= 100, p -> new Pong(p.id))
|
||||
.build());
|
||||
// #collectWhile
|
||||
}
|
||||
|
||||
void collectTypeExample() {
|
||||
// #collectType
|
||||
Flow<Message, Pong, NotUsed> flow =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue