Giter Club home page Giter Club logo

Comments (4)

rose-a avatar rose-a commented on September 26, 2024

Hi,

To close the websocket connection you need to dispose the whole GraphQLHttpClient instance.

Whats your use case?

from graphql-client.

zdenekPolicar avatar zdenekPolicar commented on September 26, 2024

Hello,
I have a web application with hundreds of users. For each user I create several subscriptions to graphql server. If the user wants, he can manually unsubscribe some. Despite calling .Dispose(), the connection remains and due to the limit of open connections on the server I want to close it.
I need to maintain and manage these connections on the server side and not on the client side, so this is how it is handled.

Thank you,
Zdenek

from graphql-client.

rose-a avatar rose-a commented on September 26, 2024

A single instance of GraphQLHttpClient only opens and maintains 1 websocket connection, which is used for all subscriptions created on it. So reducing the number of subscriptions to the same server in a web app instance won't reduce the number of websocket connections to the server (still 1 per active instance).

If you have more than one, please make sure there is just one instance of GraphQLHttpClient in your app (i.e. registered as singleton in DI), that is how its meant to be used.

from graphql-client.

zdenekPolicar avatar zdenekPolicar commented on September 26, 2024

Many thanks, i will try.

from graphql-client.

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.