github uNetworking/uWebSockets v20.32.0

latest releases: v20.67.0, v20.66.0, v20.65.0...
21 months ago

Subscription events

A new kind of event has been added. Whenever a WebSocket::subscribe or WebSocket::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:

  • the WebSocket involved
  • the topic name
  • the new number of subscribers to this topic
  • the former number of subscribers to this topic

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.

Don't miss a new uWebSockets release

NewReleases is sending notifications on new releases.