Code Monkey home page Code Monkey logo

Comments (8)

zackman0010 avatar zackman0010 commented on June 14, 2024 1

You raised a good point, so I went to a scratch sheet to test it out. It looks like, if there's both a T* and a more specific apply function available, it will use the more specific one over the T* one. Not shown in this screenshot is the final test I did where I did not explicitly define the result type (val result5 = Result(testPublisher)). It still ran the Publisher apply method.

image

The test I added on #34 also passed successfully

from reactor-scala-extensions.

rs017991 avatar rs017991 commented on June 14, 2024

@zackman0010 the ScalaConverters class adds implicit asScala methods to JFlux and JMono, so you can do like:

import reactor.core.scala.publisher.ScalaConverters

JFlux.just("whatever").asScala

from reactor-scala-extensions.

sinwe avatar sinwe commented on June 14, 2024

Or another shortcut is
val sFlux = SFlux.fromPublisher(jFlux)

from reactor-scala-extensions.

zackman0010 avatar zackman0010 commented on June 14, 2024

Thank you, I somehow missed that one when I was looking through SFlux last night.

from reactor-scala-extensions.

zackman0010 avatar zackman0010 commented on June 14, 2024

@sinwe If I submitted a merge request to add another apply method to SFlux that simply calls the fromPublisher method, which is the same thing that SMono's apply does, would it be accepted?

from reactor-scala-extensions.

sinwe avatar sinwe commented on June 14, 2024

@zackman0010 You can try and raise PR. I'm not sure if that would be working because of below

object SFlux {
    def apply[T](elements: T*): SFlux[T] = SFlux.fromIterable(elements)
}

When you do SFlux(jFlux) it might be treated as an SFlux with elements on single JFlux instead of converting the JFlux to SFlux.
But I might be wrong. That's just on top of my head.

But it'd be nice if it works because that'll make it consistent with SMono(jMono)

from reactor-scala-extensions.

sinwe avatar sinwe commented on June 14, 2024

Thanks... I’ll merge your PR soon and I’ll cut a release soon as we’ve got couple of PRs merged to master

from reactor-scala-extensions.

sinwe avatar sinwe commented on June 14, 2024

Released on v0.4.6

from reactor-scala-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.