Giter Site home page Giter Site logo

Comments (7)

meddle0x53 avatar meddle0x53 commented on June 20, 2024

This is strange, just today, I've run it. Do you run it from the current master?

from learning-rxjava.

akarnokd avatar akarnokd commented on June 20, 2024

Yes. An hour ago, this commit was the master.

Correction: I did a clean checkout and the example works through the runner, but not standalone (i.e., adding a main method and invoking run()).

from learning-rxjava.

meddle0x53 avatar meddle0x53 commented on June 20, 2024

You are right, I've never run it that way...
But I looked through your fork of the project, and you are right, the input should run on the Schedulers.io() scheduler, but I think the consumers should decide that, not the factory method.

So now the ReactiveSum example is using it with the the IO Scheduler and it will work with a main method like this:


    public static void main(String[] args) throws InterruptedException {
        CountDownLatch latch = new CountDownLatch(1);
        new ReactiveSumV1().run();

        CreateObservable.input()
        .subscribeOn(Schedulers.io())
        .filter(line -> line.equals("return"))
        .subscribe(v -> latch.countDown());

        latch.await();
    }

from learning-rxjava.

meddle0x53 avatar meddle0x53 commented on June 20, 2024

I don't want to talk about Threading and Schedulers in the first examples, the book should be readable for audience at junior level too... But you are right for everything.
The examples should be simple enough in the book, but a bit more complex in the java files - let's give opportunity to the readers to play.
And some Helper/Utility methods can be the real deal - implemented with unsubscribing and back-pressure in mind.

Btw, do you think this system with the command line application and the runner is a good choice?

from learning-rxjava.

akarnokd avatar akarnokd commented on June 20, 2024

I think standalone runnable examples would be better; I'd expect each example to be runnable from IDE directly. I can't remember when I saw such command-line menu based solution, but feels a bit too old-school to me. In addition, while we are at it, naming the package-chapters as chapter01 would make it display in-order and allow better discovery.

from learning-rxjava.

meddle0x53 avatar meddle0x53 commented on June 20, 2024

Yeah, such a naming convention would be better, additionally I'll add a main method to every example.

from learning-rxjava.

akarnokd avatar akarnokd commented on June 20, 2024

Thanks. The chapter01 examples now work for me.

from learning-rxjava.

Related Issues (6)

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.