Open jponge opened 4 months ago
As a workaround, you can create a Vert.x API object that extends ReadStream
, like the Cassandra client does:
/**
* Executes the given SQL <code>SELECT</code> statement which returns the results of the query as a read stream.
*
* @param sql the SQL to execute. For example <code>SELECT * FROM table ...</code>.
* @return a future of the result
*/
Future<CassandraRowStream> queryStream(String sql);
Nice trick
The generator does not properly support the case of
Future<ReadStream<T>>
methods (e.g., a Vert.x HTTP client response that is eventually wrapped by a JSON stream parser).The idea is to translate those to
Uni<ReadStream<T>>
where theReadStream
is a Mutiny bindings shim, so we can call.toMulti()
on it.Given the following interface:
then the generated code is:
where the following method:
does not compile: