v0.0.3 Upgrade to uWS v20.35.0 #72
cirospaciari
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is changed in socketify:
What's new in uWS since the last update?
v20.35.0
Bug fixes
v20.34.0
Easy shutdown with
app.close()
Calling this new function will:
Close and invalidate all open listen sockets.
Force close all open connections (both HTTP and WebSockets), calling their respective callbacks as needed (.on_aborted, .close, .subscription).
This call can be used to gracefully close and release an App that needs maintenance.
v20.33.0
Rebalancing with max lifetime
A reworked timeout system now allows two lightweight timeout settings for WebSockets; idle timeout (up to 16 minutes) and max lifetime (up to 4 hours):
idle timeout is how long (in seconds) a WebSocket may be idle (have no traffic) before it is considered closed.
max lifetime is how long (in minutes) a WebSocket may be connected, before being gracefully closed by the server.
Specifying a value of 0 disables the respective features (the default for max lifetime).
Why use max lifetime?
The idea here is to enforce a partial rebalancing, constantly forcing a few connections to reconnect via whatever load balancer is in use. This is a strategy used by Netflix where they found success in having max lifetime = 30 minutes.
Good values for the settings should be somewhere around 30-120 seconds idle timeout and 30-120 minutes max lifetime.
v20.32.0
Subscription events
A new kind of event has been added. Whenever a
ws.subscribe
orws.unsubscribe
call is made, or when implicit unsubscription happens (such as when a WebSocket has subscriptions and gets closed in any way), a subscription event will fire with:These events can be used to easily manage external subscriptions such as when using Redis to orchestrate multiple instances of uWS. Whenever a subscription event with new subscription count == 1; you can create the corresponding Redis subscription. Whenever a subscription event with new subscription count == 0; you can free the corresponding Redis subscription.
Work in progress for v0.1.0:
This discussion was created from the release v0.0.3 Upgrade to uWS v20.35.0.
Beta Was this translation helpful? Give feedback.
All reactions