Git Product home page Git Product logo

Comments (6)

violetagg avatar violetagg commented on June 7, 2024

@akshaysu Currently:

  1. If one uses the global LoopResources/ConnectionProvider, one can use reactor.netty.http.HttpResources#disposeLoopsAndConnections when it is appropriate because it will dispose these resources for the server and all clients that are currently running.

  2. If one provides separate LoopResources/ConnectionProvider, again one knows better when those can be disposed. Reactor Netty doesn't have the knowledge whether LoopResources/ConnectionProvider are used only for the current server/client or they are shared amongst others.

Because of 1. and 2. there is no API for disposing LoopResources/ConnectionProvider on the level of server/client.
We can try to extend the documentation. Would you like to provide a PR with changes in the documentation?

from reactor-netty.

akshaysu avatar akshaysu commented on June 7, 2024

@violetagg thanks for the reply. Sorry, I'm new to the project reactor world. What do you mean by global LoopResources/ConnectionProvider? The one provided by the library when HttpClient.create() is called? Also, what happens when one uses ConnectionProivder.newConnection()? Do I need to dispose in this case?

from reactor-netty.

violetagg avatar violetagg commented on June 7, 2024

What do you mean by global LoopResources/ConnectionProvider? The one provided by the library when HttpClient.create() is called?

Yes HttpResources is used when HttpServer/HttpClient#create() is invoked.

Also, what happens when one uses ConnectionProivder.newConnection()

This is a ConnectionProvider that closes the connection after every request i.e. if you want to disable the connection pooling.

from reactor-netty.

akshaysu avatar akshaysu commented on June 7, 2024

@violetagg If I create 2 httpclients using HttpClient.create() are they going to share same LoopReosurces and ConnectionProviders? If I just provide ConnectionProvider like HttpClient.create(provider) what is the behaviour? Are there any reference document I can dig into?
My question on ConnectionProvider.newConnection() is that does this share same resources with other httpclients? and do I need to dispose for newConnection also?

I'm using HttpClient in Database Handler for remote api call. When database is closed I need to release HttpClient also

from reactor-netty.

violetagg avatar violetagg commented on June 7, 2024

@violetagg If I create 2 httpclients using HttpClient.create() are they going to share same LoopReosurces and ConnectionProviders?

Yes

If I just provide ConnectionProvider like HttpClient.create(provider) what is the behaviour?

This particular HttpClient will run with the provided ConnectionProvider.

Are there any reference document I can dig into?

Check this
https://projectreactor.io/docs/netty/release/reference/index.html#_connection_pool_2
and this
https://projectreactor.io/docs/netty/release/reference/index.html#_event_loop_group_2

My question on ConnectionProvider.newConnection() is that does this share same resources with other httpclients? and do I need to dispose for newConnection also?

The connection created by this special ConnectionProvider is never pooled and is closed after the request/response processing i.e. you do not use any connection pooling.

from reactor-netty.

violetagg avatar violetagg commented on June 7, 2024

@akshaysu I updated the reference documentation.

from reactor-netty.

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.