Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Convert to/from Mono/JMono #4

Closed
florind opened this issue Nov 13, 2017 · 7 comments
Closed

Convert to/from Mono/JMono #4

florind opened this issue Nov 13, 2017 · 7 comments

Comments

@florind
Copy link

florind commented Nov 13, 2017

This is more a confusion I have: I am using Webflux and I need to convert from reactor.core.publisher.Flux/Mono and the reactor.core.scala.publisher.Flux/Mono counterpart.
I couldn't find an "scala.publisher.Flux.asJava" or "reactor.core.scala.publisher.Flux.asScala" straight converter, similar to those found in JavaConverters or OptionConverters so I'd like to know if there is a way to perform such conversion using the current API.

@sinwe
Copy link
Contributor

sinwe commented Nov 15, 2017

@florind There is already .asJava for converting scala to java. However, I agree that there isn't one for converting java to scala.
In 0.3.1-SNAPSHOT, I've opened up the apply method in Flux/Mono companion object, so you'll be able to use Flux(reactor.core.publisher.Flux) and Mono(reactor.core.publisher.Mono)

@sinwe sinwe closed this as completed Nov 15, 2017
@sinwe
Copy link
Contributor

sinwe commented Nov 18, 2017

@florind version 0.3.1 is released and you can convert between java and scala Mono/Flux

@Satya758
Copy link

Hi @sinwe
Flux.apply is public but Mono.apply is still private
https://github.com/reactor/reactor-scala-extensions/blob/master/src/main/scala/reactor/core/scala/publisher/Mono.scala#L1836

In this following commit, I see changes to Flux but not to Mono
faad6f9

Thanks
Satya

@sinwe
Copy link
Contributor

sinwe commented Oct 15, 2018

Thanks @Satya758, I'm currently on long holiday. If need it urgently, feel free to raise PR. I'll take a look on it

@Satya758
Copy link

@sinwe Please review the pull request

@sinwe
Copy link
Contributor

sinwe commented Oct 18, 2018

@Satya758, I've approved it but I can't release it cause it can only be released from my pc at home.

@sinwe
Copy link
Contributor

sinwe commented Nov 3, 2018

@Satya758 I've merged it to master, can you try version 0.3.7-SNAPSHOT before I release it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants