Skip to content

Releases: centrifugal/centrifuge

v0.12.0

01 Oct 22:28
30e7d1b

Choose a tag to compare

This release is a step back in Engine separation and has some important fixes and improvements. Backwards incompatible changes are all about Engine interfaces so if you are using built-in Memory or Redis engines you should be fine to upgrade. Otherwise, take a closer look on first and second points below.

  • HistoryManager interface removed and its methods now part of Broker interface{}. The reason behind this is that Broker should be responsible for an atomicity of saving message into history stream and publish to PUB/SUB. More details in #158
  • Cleaner Broker interface methods without ChannelOptions
  • Fix reconnects due to InsufficientState errors in channels with HistoryRecover option on when using Memory Engine and frequently publishing in parallel (from different goroutines)
  • Fix reconnects due to InsufficientState errors when using legacy seq, gen fields - #157
  • Fix returning custom disconnect for SockJS transport
  • Possibility to define history stream options in Publish call
  • Deprecate Broker/Engine Channels method – see #147
  • Increase test coverage up to 83% so #106 is finally closed
  • Test Sentinel scenario in CI
  • Refactor queue writer to prevent possible message loss on connection close - 160
  • Fix inconsistent tests of Redis Cluster recovery due to PUB/SUB buffering
  • Minor improvements in Gin auth example - #154

I have a plan for future library versions to remove ChannelOptionFunc completely (but still have a control over channel feature set). This is still in research – if you are interested welcome to #161.

$ gorelease -base v0.11.2 -version v0.12.0
github.com/centrifugal/centrifuge
---------------------------------
Incompatible changes:
- (*MemoryEngine).AddHistory: removed
- (*MemoryEngine).Publish: changed from func(string, *Publication, *ChannelOptions) error to func(string, *Publication, PublishOptions) (StreamPosition, error)
- (*MemoryEngine).PublishJoin: changed from func(string, *ClientInfo, *ChannelOptions) error to func(string, *ClientInfo) error
- (*MemoryEngine).PublishLeave: changed from func(string, *ClientInfo, *ChannelOptions) error to func(string, *ClientInfo) error
- (*Node).SetHistoryManager: removed
- (*RedisEngine).AddHistory: removed
- (*RedisEngine).Publish: changed from func(string, *Publication, *ChannelOptions) error to func(string, *Publication, PublishOptions) (StreamPosition, error)
- (*RedisEngine).PublishJoin: changed from func(string, *ClientInfo, *ChannelOptions) error to func(string, *ClientInfo) error
- (*RedisEngine).PublishLeave: changed from func(string, *ClientInfo, *ChannelOptions) error to func(string, *ClientInfo) error
- Broker.History: added
- Broker.Publish: changed from func(string, *Publication, *ChannelOptions) error to func(string, *Publication, PublishOptions) (StreamPosition, error)
- Broker.PublishJoin: changed from func(string, *ClientInfo, *ChannelOptions) error to func(string, *ClientInfo) error
- Broker.PublishLeave: changed from func(string, *ClientInfo, *ChannelOptions) error to func(string, *ClientInfo) error
- Broker.RemoveHistory: added
- HistoryManager.AddHistory, method set of Engine: removed
- HistoryManager: removed
- MemoryEngine: old is comparable, new is not
- PublishOptions.SkipHistory: removed
- RedisEngineConfig.PublishOnHistoryAdd: removed
Compatible changes:
- PublishOptions.HistorySize: added
- PublishOptions.HistoryTTL: added
- WithHistory: added

v0.12.0 is a valid semantic version for this release.

v0.11.2

24 Sep 08:27
84daf25

Choose a tag to compare

  • Fix non-working websocket close with custom disconnect code: this is a regression introduced by v0.11.0.

v0.11.1

19 Sep 09:45
6bc3e45

Choose a tag to compare

  • Added MetricsNamespace field of Config to configure Prometheus metrics namespace used by Centrifuge library internal metrics
  • Fix messages_sent_counter – it now correctly counts Control, Join and Leave messages
  • Redis cluster integration now tested in CI
$ gorelease -base v0.11.0 -version v0.11.1
github.com/centrifugal/centrifuge
---------------------------------
Compatible changes:
- Config.MetricsNamespace: added

v0.11.1 is a valid semantic version for this release.

v0.11.0

27 Aug 19:58
3ce8114

Choose a tag to compare

  • Refactor client channels API – see detailed changes below, #146
  • Fix atomic alignment in struct for 32-bit builds, commit
  • Field Code of Disconnect has uint32 type now instead of int, commit
  • Refactor WebSocket graceful close – do not use a new goroutine for every read, #144
  • Support client name and version fields of Connect command which will be available in ConnectEvent struct (if set on client side), #145
$ gorelease -base v0.10.1 -version v0.11.0
github.com/centrifugal/centrifuge
---------------------------------
Incompatible changes:
- (*Client).Channels: changed from func() map[string]ChannelContext to func() []string
- ChannelContext: removed
- Disconnect.Code: changed from int to uint32
Compatible changes:
- (*Client).IsSubscribed: added
- ConnectEvent.Name: added
- ConnectEvent.Version: added
- ErrorTooManyRequests: added

v0.11.0 is a valid semantic version for this release.

v0.10.1

07 Aug 18:56
5883eeb

Choose a tag to compare

  • Fix Redis Engine errors when epoch is missing inside stream/list meta hash. See commit

v0.10.0

10 Jul 17:41
feba6b4

Choose a tag to compare

This release is a massive rewrite of Centrifuge library (actually of some part of it) which should make library a more generic solution. Several opinionated and restrictive parts removed to make Centrifuge feel as a reasonably thin wrapper on top of strict client-server protocol.

Most work done inside #129 pr and relates to #128 issue.

Release highlights:

  • Layer with namespace configuration and channel rules removed. Now developer is responsible for all permission checks and channel rules.
  • Hard dependency on JWT and predefined claims removed. Users are now free to use any token implementation – like Paceto tokens for example, use any custom claims etc.
  • Event handlers that not set now always lead to Not available error returned to client.
  • All event handlers now should be set to Node before calling its Run method.
  • Centrifuge still needs to know some core options for channels to understand whether to use presence inside channels, keep Publication history stream or not. It's now done over user-defined callback function in Node Config called ChannelOptionsFunc. See its detailed description in library docs.
  • More idiomatic error handling in event handlers, see #134.
  • Aliases to Raw, Publication and ClientInfo Protobuf types removed from library public API, see #136
  • Support Redis Sentinel password option

Look at updated example in README and examples folder to find out more.

I hope to provide more guidance about library concepts in the future. I feel sorry for breaking things here but since we don't have v1 release yet, I believe this is acceptable. An important note is that while this release has lots of removed parts it's still possible (and not too hard) to implement the same functionality as before on top of this library. Feel free to ask any questions in our community chats.

v0.9.1

05 Jul 09:30
116c717

Choose a tag to compare

  • fix Close method – do not use error channel since this leads to deadlock anyway, just close in goroutine.
  • fix presence timer scheduling
gorelease -base=v0.9.0 -version=v0.9.1
github.com/centrifugal/centrifuge
---------------------------------
Incompatible changes:
- (*Client).Close: changed from func(*Disconnect) chan error to func(*Disconnect) error

v0.9.1 is a valid semantic version for this release.

v0.9.0

17 Jun 08:04
7582407

Choose a tag to compare

This release has some API changes. Here is a list of all changes in release:

Incompatible changes:
- (*Client).Close: changed from func(*Disconnect) error to func(*Disconnect) chan error
- (*Client).Handle: removed
- Config.ClientPresencePingInterval: removed
- NewClient: changed from func(context.Context, *Node, Transport) (*Client, error) to func(context.Context, *Node, Transport) (*TransportClient, CloseFunc, error)
- NodeEventHub.ClientRefresh: removed
- RefreshHandler: changed from func(context.Context, *Client, RefreshEvent) RefreshReply to func(RefreshEvent) RefreshReply
Compatible changes:
- (*ClientEventHub).Presence: added
- (*ClientEventHub).Refresh: added
- CloseFunc: added
- Config.ClientPresenceUpdateInterval: added
- ConnectReply.ClientSideRefresh: added
- PresenceEvent: added
- PresenceHandler: added
- PresenceReply: added
- RefreshEvent.Token: added
- RefreshReply.Disconnect: added
- TransportClient: added

Now let's try to highlight most notable changes and reasoning behind:

  • NewClient returns TransportClient and CloseFunc to limit possible API on transport implementation level
  • ClientPresencePingInterval config option renamed to ClientPresenceUpdateInterval
  • Centrifuge now has client.On().Presence handler which will be called periodically while connection alive every ClientPresenceUpdateInterval
  • Client.Close method now creates a goroutine internally - this was required to prevent deadlock when closing client from Presence and SubRefresh callback handlers.
  • Refresh handler moved to Client scope instead of being Node event handler
  • ConnectReply now has new ClientSideRefresh field which allows setting what kind of refresh mechanism should be used for a client: server-side refresh or client-side refresh.
  • It's now possible to do client-side refresh with custom token implementation (example)
  • Library now uses one concurrent timer per each connection instead of 3 - should perform a bit better

All examples updated to reflect all changes here.

v0.8.2

17 May 11:17
cb6714b

Choose a tag to compare

  • Fix Disconnect Code field unmarshalling, introduce helper method Disconnect.CloseText() to build close text sent to client in Close Frame.
  • Fix server-side Join event wrong channel when server subscribed client to several channels with JoinLeave feature on

v0.8.1

17 May 11:17
c50fecc

Choose a tag to compare

  • Fix closing connections with insufficient state after publish when history recovery feature is on and PublishOnHistoryAdd is false in Redis Engine config. #119.