chore: Add Source.fromArray operator for Java dsl. (#1248)

This commit is contained in:
He-Pin(kerr) 2024-04-30 22:52:39 +08:00 committed by GitHub
parent b5eb6ff01a
commit 2c3e9b43b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 126 additions and 0 deletions

View file

@ -60,6 +60,14 @@ public class SourceDocExamples {
// #source-from-example
}
private static void fromArrayExample() {
final ActorSystem system = null;
// #source-from-array
Source<String, NotUsed> words = Source.fromArray("Hello world".split("\\s"));
words.runForeach(System.out::println, system);
// #source-from-array
}
static void rangeExample() {
final ActorSystem system = ActorSystem.create("Source");