feat: Add create method to PFBuilder. (#947)

This commit is contained in:
He-Pin(kerr) 2024-01-15 17:37:14 +08:00 committed by GitHub
parent cf70478201
commit df302b8ee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 25 additions and 18 deletions

View file

@ -260,7 +260,9 @@ public class BidiFlowDocTest extends AbstractJavaTest {
final Flow<Message, Message, NotUsed> pingpong =
Flow.of(Message.class)
.collect(
new PFBuilder<Message, Message>().match(Ping.class, p -> new Pong(p.id)).build());
PFBuilder.<Message, Message>create()
.match(Ping.class, p -> new Pong(p.id))
.build());
final Flow<Message, Message, NotUsed> flow = stack.atop(stack.reversed()).join(pingpong);
final CompletionStage<List<Message>> result =
Source.from(Arrays.asList(0, 1, 2))