Skip to content

Commit

Permalink
Merge pull request #10073 from tsegismont/multi-from-iterable
Browse files Browse the repository at this point in the history
Reactive Pg Client: Mutiny can create a multi from Iterable
  • Loading branch information
FroMage authored Jun 17, 2020
2 parents 7b66698 + 7c37d61 commit dd4f52f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/reactive-sql-clients.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ A `RowSet` is an `java.lang.Iterable<Row>` and thus can be converted to a `Multi
[source,java]
----
Multi<Fruit> fruits = rowSet
.onItem().produceMulti(set -> Multi.createFrom().items(() -> StreamSupport.stream(set.spliterator(), false)))
.onItem().produceMulti(set -> Multi.createFrom().iterable(set))
.onItem().apply(Fruit::from);
----

Expand All @@ -243,7 +243,7 @@ Putting it all together, the `Fruit.findAll` method looks like:
----
public static Multi<Fruit> findAll(PgPool client) {
return client.query("SELECT id, name FROM fruits ORDER BY name ASC").execute()
.onItem().produceMulti(set -> Multi.createFrom().items(() -> StreamSupport.stream(set.spliterator(), false)))
.onItem().produceMulti(set -> Multi.createFrom().iterable(set))
.onItem().apply(Fruit::from);
}
----
Expand Down

0 comments on commit dd4f52f

Please sign in to comment.