Skip to content

Commit

Permalink
minor changelog and comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Jan 26, 2022
1 parent 43cb282 commit 1ff9c45
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func main() {
cfg := centrifuge.DefaultConfig

// Node is the core object in Centrifuge library responsible for
// many useful things. For example Node allows to publish messages
// many useful things. For example Node allows publishing messages
// to channels with its Publish method.
node, err := centrifuge.New(cfg)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions _examples/custom_engine_tarantool/tntengine/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ var _ centrifuge.Broker = (*Broker)(nil)
type BrokerConfig struct {
// HistoryMetaTTL sets a time of stream meta key expiration in Tarantool. Stream
// meta key is a Tarantool HASH that contains top offset in channel and epoch value.
// By default stream meta keys do not expire.
// By default, stream meta keys do not expire.
HistoryMetaTTL time.Duration

// UsePolling allows to turn on polling mode instead of push.
// UsePolling allows turning on polling mode instead of push.
UsePolling bool

// Shards is a list of Tarantool instances to shard data by channel.
Expand Down
4 changes: 2 additions & 2 deletions _examples/jwt_token/jwt/token_verifier_jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
type ConnectToken struct {
// UserID tells library an ID of connecting user.
UserID string
// ExpireAt allows to set time in future when connection must be validated.
// ExpireAt allows setting time in future when connection must be validated.
// Validation can be server-side or client-side using Refresh handler.
ExpireAt int64
// Info contains additional information about connection. It will be
Expand All @@ -35,7 +35,7 @@ type SubscribeToken struct {
// Channel client wants to subscribe. Will be compared with channel in
// subscribe command.
Channel string
// ExpireAt allows to set time in future when connection must be validated.
// ExpireAt allows setting time in future when connection must be validated.
// Validation can be server-side or client-side using SubRefresh handler.
ExpireAt int64
// Info contains additional information about connection in channel.
Expand Down
4 changes: 2 additions & 2 deletions _examples/unidirectional_ws/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ type WebsocketConfig struct {
// See possible value description at https://golang.org/pkg/compress/flate/#NewWriter
CompressionLevel int

// CompressionMinSize allows to set minimal limit in bytes for
// CompressionMinSize allows setting minimal limit in bytes for
// message to use compression when writing it into client connection.
// By default it's 0 - i.e. all messages will be compressed when
// By default, it's 0 - i.e. all messages will be compressed when
// WebsocketCompression enabled and compression negotiated with client.
CompressionMinSize int

Expand Down
2 changes: 1 addition & 1 deletion broker_memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/centrifugal/centrifuge/internal/priority"
)

// MemoryBroker is builtin default Broker which allows to run Centrifuge-based
// MemoryBroker is builtin default Broker which allows running Centrifuge-based
// server without any external broker. All data managed inside process memory.
//
// With this Broker you can only run single Centrifuge node. If you need to scale
Expand Down
8 changes: 3 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
v0.20.0
=======

Centrifuge v0.20.0 comes with new client protocol support and some internal optimizations. It improves Survey method, refactors Disconnect code semantics. While there are many changes it should be possible to adopt v0.20.0 without any backwards compatibility issues. Client connectors which support client protocol v2 will be released soon.

* Support client protocol v2. In v0.20.0 it's considered experimental but the plan is to make it default in the future releases. The initial motivation described in [#217](https://github.com/centrifugal/centrifuge/issues/217) and implementation is in [#218](https://github.com/centrifugal/centrifuge/pull/218).
* Support client protocol v2. As of v0.20.0 it's considered experimental and can have some adjustments in the following releases. But the plan is to make it default at some point. The initial motivation described in [#217](https://github.com/centrifugal/centrifuge/issues/217) and implementation is in [#218](https://github.com/centrifugal/centrifuge/pull/218). Client connectors which support client protocol v2 will be released soon. Both `WebsocketConfig` and `SockjsConfig` now have an option to set default protocol version handler will expect from connecting clients. It's also possible to override that option by using `cf_protocol_version` URL parameter (`v1` or `v2`) when connecting to the server. This should provide a way to migrate to new protocol gradually.
* Refactor disconnect semantics for client protocol v2. We are getting rid of JSON in close reason by introducing strict ranges for disconnect codes - see [#221](https://github.com/centrifugal/centrifuge/pull/221). Client connectors will expose disconnect codes when working with client protocol v2. Client-side disconnect reasons will also have its own codes – according to [this comment](https://github.com/centrifugal/centrifuge/issues/149#issuecomment-727551279).
* Various optimizations in message broadcast, client command handling, client initial connect.
* Various optimizations in message broadcast, client command handling, client initial connect – fewer things now escape to the heap.
* `TransportWriteEvent.IsPush` field is removed (we can discuss putting it back later if required).
* Node `Survey` API now allows choosing the node to which we want to send survey request.
* Warn log level introduced between info and error.
* Warn log level introduced between Info and Error.
* Publication now has `Tags` field (`map[string]string`) – this may help to put some useful info into publication without modifying payload. It can help to avoid processing payload in some scenarios.
* Support for setting auth user in Redis shard configuration – for Redis itself and for Sentinel. This is useful is ACL-based auth used on Redis side.

Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func WithDisconnectClient(clientID string) DisconnectOption {
}
}

// WithDisconnectClientWhitelist allows to set ClientWhitelist.
// WithDisconnectClientWhitelist allows setting ClientWhitelist.
func WithDisconnectClientWhitelist(whitelist []string) DisconnectOption {
return func(opts *DisconnectOptions) {
opts.ClientWhitelist = whitelist
Expand Down
2 changes: 1 addition & 1 deletion presence_memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sync"
)

// MemoryPresenceManager is builtin default PresenceManager which allows to run
// MemoryPresenceManager is builtin default PresenceManager which allows running
// Centrifuge-based server without any external storage. All data managed inside process
// memory.
//
Expand Down

0 comments on commit 1ff9c45

Please sign in to comment.