Comments (5)
Empty string already used as a sign to make operation with all things - in unsubscribe
command empty channel unsubscribes user from all channels. So I think empty string should be ok to keep support the same semantics. At moment Centrifugo just closes connections when processes disconnect
API cmd, now we need to send disconnect message to clients. As you know there is reconnect
flag in it. This reconnect flag will be optionally set in web interface and by default will be true
I suppose - so even if disconnect button was pressed accidentally from web interface - users will reconnect.
from centrifugo.
Can make this empty string const
at moment and then move to configuration if needed. The problem I came across while thinking how to make this is that disconnecting all users is operation that takes a time - so some of users can disconnect and even reconnect during this operation (especially if application has many users). So I can't decide - is this ok or not? What can we do with this case and should we? Just locking client hub won't help as new connections will be just queued for a while. Setting extra flags on the time of operation looks like overengineering. @banks whats your thoughts?
from centrifugo.
Yeah so this is not as simple as I thought - I assumed disconnect already sent message back to client.
So let me re-state what I actually want rather than just suggest we change this existing feature.
What would be useful in some cases would be te ability to put a whole centrifguo cluster into "load shedding" mode where they:
- deny incoming requests with a permanent error
- close all existing connections with a
reconnect: false
message
The motivation is that in real-world we see clients still connected weeks after stopping a load test of centrifugo. For example, I ran a load test which had about 50k users connected and I still see about 100 users connected now - over a week since I stopped including JS on the page that makes the connections! For first 24 hours after load test it's in the thousands.
One way to achieve this would be to have some application property that is checked on each request (like config properties are) and then just make and admin API to toggle it with enough warnings about how destructive it is.
Honestly not sure if it's worth it though if it's relatively hard to do. There are other ways to acheive same thing - alter HMAC secret and restart for a while so that all the reconnects are failed permenantly due to bad auth for example. (not tried that but I assume it would work).
from centrifugo.
Trick with altering secret should help.
There is already shutdown method called when SIGINT received. And shutdown property in application. Maybe try to make shutdown as button in web interface? At moment on shutdown connections just closed - so will reconnect, maybe shutdown with optional reconnect flag? But anyway there may be some users that have not processed disconnect message and will try to reconnect.
from centrifugo.
Closing with won't do
resolution, because as time goes there is still no obvious solution. Hopefully this is a rare requirement and changing secret can be a reasonable workaround to solve this case.
from centrifugo.
Related Issues (20)
- [bug] The ID specified in XADD is equal or smaller than the target stream top item HOT 5
- [bug] getting "already subscribed" on page refresh HOT 3
- [feature] Silently Reject Publish Attempts on Proxied Channel Without Sending Client Errors HOT 4
- [question] What are the ways of decreasing the message payload? HOT 1
- [feature] Better error message when subscription token is used as connection token
- Unable To Connect With anonymous mode HOT 4
- [feature] serve admin interface via http2 HOT 4
- [feature] Send server time in initial connect response. HOT 2
- [question] Upgrading to 4.1.5 increase in response time HOT 3
- "Websocket Is Closed Before The Connection Is Established" - Web console error HOT 8
- [feature] Support for MessagePack Serialization HOT 2
- How to add multyple aud for a token in config file HOT 1
- [question] History StreamPosition and circular offsets. HOT 7
- [question] Centrifugo customization HOT 13
- [question] Support for Rate Limiting Messages Sent to Clients HOT 2
- [bug] centrifugo-pro not getting OnPublishEvents when using a token with channels claim HOT 4
- [bug] Can't pull history with channel JWT HOT 7
- [bug] With protobuf binary, RPCRequest.Data is empty. HOT 3
- [question] jwt invalid token in subscriptions HOT 3
- `bad request` and `disconnect` immediately after connection established HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from centrifugo.