Skip to content

Commit

Permalink
Reactive Pg Client: Mutiny can create a multi from Iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
tsegismont authored and johnaohara committed Jun 29, 2020
1 parent 74183a1 commit c844b50
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 c844b50

Please sign in to comment.