Skip to content

v0.31.0

Compare
Choose a tag to compare
@FZambia FZambia released this 02 Mar 10:22
· 66 commits to master since this release
dbce3c1

What's Changed

This is quite a huge release. It has several backwards incompatible changes: in PresenceManager and Broker interfaces. Also, SockJS transport was removed. And several nice improvements are here. Check out the details below.

Notable changes

  • ❗Embed Gorilla Websocket to Centrifuge internal package by @FZambia in #354 . This was an unfortunate but weighted decision due to poor maintenance of Gorilla WebSocket these days. See the exact motivation in #353.
  • ❗SockJS transport was removed - see #352. Note, that since transport in Centrifuge is pluggable - you can still use SockJS in your projects if you need it. You can take SockJS transport implementation from Centrifugo (which is required to keep SockJS until v6 - that's why we still have it there).
  • 🔥 Addition of Idempotency key for Publish API by @FZambia in #336 . Centrifuge keeps publications with idempotency key set in cache for 5 mins by default and drops publications with the same key. See WithIdempotencyKey and WithIdempotentResultTTL. Check out how this could be useful in practice in Centrifugo chat/messenger tutorial. This required change in Broker interface Publish method (should not affect most users until they use custom Broker, but simple to adopt otherwise)
  • 🔥 Maintain user mapping in Redis to speed up presence stats significantly by @FZambia in #343 . This required changes in PresenceManager interface (should not affect most users until they use custom PresenceManager, but simple to adopt otherwise). But the benefit is that we have new option for RedisPresenceManager called EnableUserMapping - this allows increasing performance of PresenceStats call drastically. For channels with huge amount of subscribers the benefit may be up to 10000x better performance. Though more memory may be required on Redis side (up to 2x) since Centrifuge keeps additional data structure in that case. See also related discussion in Centrifugo
  • 🐍 Python real-time SDK - this is a 6th official real-time SDK in Centrifugal ecosystem. We had this SDK for old versions of Centrifuge/Centrifugo – but now it was revived for the latest protocol and supports all major Centrifugal protocol features.

Other changes

  • Increments cristalhq/jwt to v5 by @shyce in #351
  • All dependencies bumped to latest versions

New Contributors ❤️

All API additions/changes

Using gorelease tool:

❯ gorelease -base v0.30.6 -version v0.31.0
# github.com/centrifugal/centrifuge
## incompatible changes
(*MemoryBroker).Publish: changed from func(string, []byte, PublishOptions) (StreamPosition, error) to func(string, []byte, PublishOptions) (StreamPosition, bool, error)
(*MemoryPresenceManager).RemovePresence: changed from func(string, string) error to func(string, string, string) error
(*RedisBroker).Publish: changed from func(string, []byte, PublishOptions) (StreamPosition, error) to func(string, []byte, PublishOptions) (StreamPosition, bool, error)
(*RedisPresenceManager).RemovePresence: changed from func(string, string) error to func(string, string, string) error
Broker.Publish: changed from func(string, []byte, PublishOptions) (StreamPosition, error) to func(string, []byte, PublishOptions) (StreamPosition, bool, error)
NewSockjsHandler: removed
PresenceManager.RemovePresence: changed from func(string, string) error to func(string, string, string) error
SockjsConfig: removed
SockjsHandler: removed
## compatible changes
PublishOptions.IdempotencyKey: added
PublishOptions.IdempotentResultTTL: added
PublishResult.FromCache: added
RedisBrokerConfig.SkipPubSub: added
RedisPresenceManagerConfig.EnableUserMapping: added
WithIdempotencyKey: added
WithIdempotentResultTTL: added

# summary
v0.31.0 is a valid semantic version for this release.

Full Changelog: v0.30.6...v0.31.0