Giter Site home page Giter Site logo

Comments (7)

FZambia avatar FZambia commented on June 2, 2024

Hello @bfwbbrj

No such plans. Do I understand right you mean setting this struct on individual connection level, i.e. as part of ConnectReply? Based on which criteria? What is the use case?

from centrifuge.

bfwbbrj avatar bfwbbrj commented on June 2, 2024

Hello @bfwbbrj

No such plans. Do I understand right you mean setting this struct on individual connection level, i.e. as part of ConnectReply? Based on which criteria? What is the use case?

I'm currently building a service that will provide real-time message functionalities to other services. And each of those service need to have a custom connection timeout(i.e the ping/pong interval). From what I read in the websocket implementations, the ping/pong interval can only be set on the app level or the transport level. So it'd be great if I can set the ping/pong interval for each client(connection) in the ConnectReply.

from centrifuge.

bfwbbrj avatar bfwbbrj commented on June 2, 2024

Hello @bfwbbrj
No such plans. Do I understand right you mean setting this struct on individual connection level, i.e. as part of ConnectReply? Based on which criteria? What is the use case?

I'm currently building a service that will provide real-time message functionalities to other services. And each of those service need to have a custom connection timeout(i.e the ping/pong interval). From what I read in the websocket implementations, the ping/pong interval can only be set on the app level or the transport level. So it'd be great if I can set the ping/pong interval for each client(connection) in the ConnectReply.

@FZambia

from centrifuge.

bfwbbrj avatar bfwbbrj commented on June 2, 2024

Another question. From my understanding, unidirectional client means that they can only receive message from server side and not vice versa, is this correct? I'm asking this because, for some reasons, I can only use c# in client side. And it seems that there's no c# client sdk provided. Thanks!

from centrifuge.

FZambia avatar FZambia commented on June 2, 2024

I'm currently building a service that will provide real-time message functionalities to other services. And each of those service need to have a custom connection timeout(i.e the ping/pong interval).

But why? I understand you need this from your first message, I am curious why exactly this is necessary in your case?

Another question. From my understanding, unidirectional client means that they can only receive message from server side and not vice versa, is this correct? I'm asking this because, for some reasons, I can only use c# in client side. And it seems that there's no c# client sdk provided.

Yeah... Unfortunately we don't have C# SDK - this is a very popular request from the community, hope it will be available at some point, definitely first in the queue (but we don't have worker processes to process this queue currently 🙂). You are right about unidirectional clients, you can read some Centrifugo docs BTW which may be considered as some extra doc for Centrifuge lib:

Centrifuge does not have built-in unidirectional transport implementation - we only provide a way to build such type of transport on top of Centrifuge (what Centrifugo server does actually). And we have some examples here – but better to look at Centrifugo source code, for example for unidirectional HTTP streaming

from centrifuge.

bfwbbrj avatar bfwbbrj commented on June 2, 2024

@FZambia

But why? I understand you need this from your first message, I am curious why exactly this is necessary in your case?

This is because I'm building a multi-tenant service, and each of tenant will need to have their own timeout intervals. Suppose we have a chat service and an online game service as tenants of my service, the timeout interval of the game will probably need to be shorter than the chat's. Since they are all connected to the same server(s), if connection level timeout interval is not customerizable, all connections from the chat and the game will share the same timeout, which could potentially lead to something bad. I can work around this by dynamically creating new server with different configuration when new connection arrives or implement my own heartbeat on top of centrifuge. But either of these would require some extra work that's not trivial. So I really hope you guys can add the option to set individual connection's timeout interval.

https://centrifugal.dev/docs/transports/overview#unidirectional
https://centrifugal.dev/docs/transports/uni_websocket
https://centrifugal.dev/docs/transports/uni_http_stream
https://centrifugal.dev/docs/transports/uni_sse
Centrifuge does not have built-in unidirectional transport implementation - we only provide a way to build such type of >transport on top of Centrifuge (what Centrifugo server does actually). And we have some examples here – but better to >look at Centrifugo source code, for example [for unidirectional HTTP streaming]>>(https://github.com/centrifugal/centrifugo/tree/master/internal/unihttpstream)

Thanks! I will start building my own client from here.

from centrifuge.

FZambia avatar FZambia commented on June 2, 2024

Regarding per-client ping/pong. In general I understood the reasoning, thanks for details. It's possible to add. The downside here that it will increase memory usage per connection a bit – sth I am trying to struggle with. But a couple of int fields won't result into sth dramatic.

I can come back to this a bit later – most probably after releasing #284 and Centrifugo v5. Maybe you want to send PR - it can speed up things a bit.

from centrifuge.

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.