Git Product home page Git Product logo

Comments (3)

rmichela avatar rmichela commented on June 14, 2024

Hi @bartlomiej-dawidow,
I haven't been ignoring your question. It really got me thinking and ultimately drove some changes to RxGrpc.

The .observeOn() calls you pointed out were originally added from a lot of experimentation while developing early versions of RxGrpc. Your question inspired me to dig deeper.

The way I'm using .observeOn() takes advantage of its internal buffer. A typical user calls .subscribe(x -> handleX(x)). Under the hood, this translates to a request(Long.MAX_VALUE) request. I don't want to send request(Long.MAX_VALUE) back through the gRPC service. For comparison, gRPC's automatic flow control calls request(1) each time a new message is requested. The .observeOn() internal 128 message buffer helps bridge the flow control. When a downstream subscriber calls request(Long.MAX_VALUE), .observeOn() translates that to many upstream request(128) calls, which gRPC can handle.

After some further experimentation, I found a way to get the functionality out of .observeOn() without needing to spin up a new thread pool.

from reactive-grpc.

bartlomiej-dawidow avatar bartlomiej-dawidow commented on June 14, 2024

Hi @rmichela, first of all thanks for your explanation and the fix.
I just verified that version de7552b does not spawn the extraneous threads.

There are still two grpc-default-executor threads but I'm guessing they are started by DnsNameResolver.

from reactive-grpc.

rmichela avatar rmichela commented on June 14, 2024

That sounds right. I'll be cutting a release in the next day or so.

from reactive-grpc.

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.