Docs: Actor source stream operators (#29178)
This commit is contained in:
parent
2c4e114ecd
commit
bc68f0d650
12 changed files with 288 additions and 29 deletions
|
|
@ -108,13 +108,15 @@ public class SourceDocExamples {
|
|||
final ActorSystem system = null;
|
||||
|
||||
// #actorRefWithBackpressure
|
||||
Source<Object, ActorRef> source =
|
||||
Source.actorRefWithBackpressure(
|
||||
Source<String, ActorRef> source =
|
||||
Source.<String>actorRefWithBackpressure(
|
||||
"ack",
|
||||
// complete when we send "complete"
|
||||
o -> {
|
||||
if (o == "complete") return Optional.of(CompletionStrategy.draining());
|
||||
else return Optional.empty();
|
||||
},
|
||||
// do not fail on any message
|
||||
o -> Optional.empty());
|
||||
|
||||
ActorRef actorRef = source.to(Sink.foreach(System.out::println)).run(system);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue