Releases: centrifugal/centrifuge
v0.12.0
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.
HistoryManagerinterface removed and its methods now part ofBrokerinterface{}. 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
Brokerinterface methods withoutChannelOptions - Fix reconnects due to
InsufficientStateerrors in channels withHistoryRecoveroption on when using Memory Engine and frequently publishing in parallel (from different goroutines) - Fix reconnects due to
InsufficientStateerrors when using legacy seq, gen fields - #157 - Fix returning custom disconnect for SockJS transport
- Possibility to define history stream options in
Publishcall - Deprecate Broker/Engine
Channelsmethod – 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
v0.11.1
- Added
MetricsNamespacefield ofConfigto 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
- Refactor client channels API – see detailed changes below, #146
- Fix atomic alignment in struct for 32-bit builds, commit
- Field
CodeofDisconnecthasuint32type now instead ofint, commit - Refactor WebSocket graceful close – do not use a new goroutine for every read, #144
- Support client name and version fields of
Connectcommand which will be available inConnectEventstruct (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
v0.10.0
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 availableerror returned to client. - All event handlers now should be set to
Nodebefore calling itsRunmethod. - 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,PublicationandClientInfoProtobuf 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
- fix
Closemethod – 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
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:
NewClientreturnsTransportClientandCloseFuncto limit possible API on transport implementation levelClientPresencePingIntervalconfig option renamed toClientPresenceUpdateInterval- Centrifuge now has
client.On().Presencehandler which will be called periodically while connection alive everyClientPresenceUpdateInterval Client.Closemethod now creates a goroutine internally - this was required to prevent deadlock when closing client from Presence and SubRefresh callback handlers.- Refresh handler moved to
Clientscope instead of beingNodeevent handler ConnectReplynow has newClientSideRefreshfield 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.