Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uni lacks replacing with void #486

Closed
jponge opened this issue Feb 24, 2021 · 0 comments · Fixed by #487
Closed

Uni lacks replacing with void #486

jponge opened this issue Feb 24, 2021 · 0 comments · Fixed by #487
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jponge
Copy link
Member

jponge commented Feb 24, 2021

When writing code such as:

return vertx.createHttpServer()
      .requestHandler(router::handle)
      .listen(8080)
      .onItem().invoke(() -> logger.info("HTTP server listening on port 8080"))
      .replaceWith(Uni.createFrom().voidItem());

where the return value is expected to be a Uni<Void>, then we cannot simplify with replaceWithNull since it keeps the original parametric type, yet with a null value.

We should add replaceWithVoid, as in:

return vertx.createHttpServer()
      .requestHandler(router::handle)
      .listen(8080)
      .onItem().invoke(() -> logger.info("HTTP server listening on port 8080"))
      .replaceWithVoid();
@jponge jponge added the enhancement New feature or request label Feb 24, 2021
@jponge jponge added this to the 0.15.0 milestone Feb 24, 2021
@jponge jponge self-assigned this Feb 24, 2021
jponge added a commit that referenced this issue Feb 24, 2021
Uni.replaceWithNull is useful, but sometimes we need the return type to be switched to Void.

Fixes #486
jponge added a commit that referenced this issue Feb 24, 2021
Uni.replaceWithNull is useful, but sometimes we need the return type to be switched to Void.

Fixes #486
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant