Release Notes
This page contains combined release notes for major and minor releases of all AnyCable libraries.
1.3.0
Features
Common
Configuration presets (aka sensible defaults).
AnyCable now automatically detects known platforms (Heroku, Fly) and tunes configuration accordingly. Right now, Fly.io support is the most comprehensive and allows you to automatically connect Ruby and AnyCable-Go apps to each other (by setting correct RPC and broadcasting URLs).
See documentation for AnyCable and AnyCable-Go.
AnyCable-Go
Added adaptive concurrency support.
Users of AnyCable had to scale and balance resources on two sides: RPC and AnyCable-Go. Now AnyCable-Go can adjust its concurrency limit automatically to minimize errors (
ResourcesExhausted
) and maximize throughput (thus, reduce the backlog size) if possible. This means, you only have to scale the Rails application, and AnyCable-Go will balance itself alongside automatically.See documentation.
AnyCable-Go
Embedded NATS support.
Now it's possible to run a NATS server within an AnyCable-Go process, so you don't need to deploy a pub/sub engine yourself.
See documentation.
StatsD and metric tags are now generally available (dowstreamed from PRO).
See documentation.
Added support for WebSocket endpoint paths.
Now you can specify wildcards and placeholders in a WS endpoint for
anycable-go
:anycable-go --path="/{tenant}/cable
This could be helpful to differentiate between clients or even different Action Cable Connection class instances at a Ruby side.
Added
grpc_active_conn_num
metrics.Now you can monitor the actual number of gRPC connections established between a WebSocket server and RPC servers.
AnyCable Ruby
Added experimental support for grpc_kit as a gRPC server implementation.
Add
grpc_kit
to your Gemfile and specifyANYCABLE_GRPC_IMPL=grpc_kit
env var to use it.Added mutual TLS support for connections to Redis.
AnyCable Rails
NOTE: Changes below are for v1.3.7 of the anycable-rails
gem.
Added Rails 7+ error reporting interface integration.
If your error reporting software supports Rails built-in error reporting (e.g., Sentry does), you no longer need to configure
AnyCable.capture_exception { ... }
yourself.
Changes
AnyCable Ruby
A new configuration paramter,
rpc_max_connection_age
, has been added to replace the previousrpc_server_args.max_connection_age_ms
(orANYCABLE_RPC_SERVER_ARGS__MAX_CONNECTION_AGE_MS
).It comes with the default value of 300 (5 minutes).
NOTE: The
rpc_max_connection_age
accepts seconds, not milliseconds.
For full list of changes see the corresponding change logs:
1.2.0
Features
Add fastlane subscribing for Hotwire (Turbo Streams) and CableReady.
Make it possible to terminate subscription requests at AnyCable Go without performing RPC calls.
See documentation.
Add JWT authentication/identification support.
You can pass a properly structured token along the connection request to authorize the connection and set up identifiers without peforming an RPC call.
See documentation.
1.1.0
tl;dr Housekeeping and internals refactoring, prepare for non-gRPC RPC, minor but useful additions.
See also upgrade notes.
Features
Added ability to embed AnyCable RPC into any Ruby process.
When using
anycable-rails
, setembedded: true
in the configuration to launch RPC along withrails s
(only for Rails 6.1+).For any other Ruby process, drop the following snippet to launch an RPC server:
require "anycable/cli" AnyCable::CLI.embed!(*args) # args is a space-separated list of CLI args
New metrics for
anycable-go
:server_msg_total
andfailed_server_msg_total
: the total number of messages sent (or failed to send) by server.data_sent_bytes_total
anddata_rcvd_bytes_total
: the total amount of bytes sent to (or received from) clients.
New configuration parameters for
anycable-go
:--max-conn
: hard-limit the number of simultaneous server connections.--allowed_origins
: a comma-separated list of hostnames to check the Origin header against during the WebSocket Upgrade; supports wildcards, e.g.,--allowed_origins=*.evl.ms,www.evlms.io
.--ping_timestamp_precision
: define the precision for timestamps in ping messages (s, ms, ns).
Changes
Ruby 2.6+ is required for all Ruby gems (
anycable
,anycable-rails
,anycable-rack-server
).Rails 6.0+ is required for
anycable-rails
.Dropped deprecated AnyCable RPC v0.6 support.
The
anycable
gem has been split intoanycable-core
andanycable
.The first one contains an abstract RPC implementation and all the supporting tools (CLI, Protobuf), the second one adds the gRPC implementation.
BREAKING Middlewares are no longer inherited from gRPC interceptors.
That allowed us to have real middlewares with ability to modify responses, intercept exceptions, etc. The API changed a bit:
class SomeMiddleware < AnyCable::Middleware - def call(request, rpc_call, rpc_handler) + def call(rpc_method_name, request, metadata) yield end end
Broadcasting messages is now happening concurrently.
Now new broadcast messages are handled (and re-transmitted) concurrently by a pool of workers (Go routines). You can control the size of the pool via the
--hub_gopool_size
configuration parameter of theanycable-go
server (defaults to 16).
For internal changes see the corresponding change logs:
1.0.0
tl;dr API stabilization, better Action Cable compatibility, Stimulus Reflex compatibility, improved RPC communication, state persistence, HTTP broadcast adapter, Rails generators.
Read more about the first major release of AnyCable in Evil Martians chronicles.
See also upgrade notes.
Features
Configure AnyCable for Rails apps via
rails g anycable:setup
.This interactive generator guides you through all the required steps to make AnyCable up and running for development and production.
Channel state, or
state_attr_accessor
.Similarly to connection identifiers, it is now possible to store arbitrary* data for subscriptions (channel instances). Using
state_attr_accessor :a, :b
(fromanycable-rails
) you can define readers and writers to keep channel state between commands. When AnyCable is not activated (i.e., a different adapter is used for Action Cable), this method behaves likeattr_accessor
.* GlobalID is used for serialization and deserialization of non-primitive objects.
Rack middlewares support in Rails.
You can use Rack middlewares to enhance AnyCable
request
object. For that, add required middlewares toAnyCable::Rails::Rack.middleware
using the same API as for Rails middleware.By default, only session store middleware is included, which allows you to access
request.session
without any hacks.A typical use-case is adding a Warden middleware for Devise-backed authentication.
See documentation.
Underlying HTTP request data in now accessible in all RPC methods.
That is, you can access
request
object in channels, too (e.g., headers/cookies/URL/etc).Remote disconnects.
Disconnecting remote clients via
ActionCable.server.remote_connections.where(...).disconnect
is now supported.Rails session persistence.
Now
request.session
could be persisted between RPC calls, and hence be used as a per-connection store. Originally added for Stimulus Reflex compatibility.NOTE: This feature is optional and should be enabled explicitly in
anycable-rails
configuration.See documentation.
HTTP broadcast adapter.
Now you can experiment with AnyCable without having to install Redis.
See documentation.
NOTE: Supported by
anycable
gem andanycable-go
.Unsubscribing from a particular stream.
See the corresponding Rails PR.
Redis Sentinel support.
Both
anycable
gem andanycable-go
now support using Redis with Sentinels.See documentation.
New metrics for
anycable-go
:mem_sys_bytes
: the total bytes of memory obtained from the OSrpc_retries_total
: the total number of retried RPC calls (higher number could indicate incorrect concurrency configuration)
New configuration parameters for
anycable-go
:rpc_concurrency
: the limit on the number of concurrent RPC calls (read documentation).enable_ws_compression
: enable WebSocket per-message compression (disabled by default).disconnect_timeout
: specify the timeout for graceful shutdown of the disconnect queue (read documentation)disable_disconnect
: disable calling disconnect/unsubscribe callbacks.
Changes
New RPC schema.
Check out the annotated new schema.
Ruby 2.5+ is required for all Ruby gems (
anycable
,anycable-rails
,anycable-rack-server
).Docker versioning changed from
vX.Y.Z
toX.Y.Z
foranycable-go
.Now you can specify only the part of the version, e.g.
anycable-go:1.0
instead of the fullanycable-go:v1.0.0
.
For internal changes see the corresponding change logs: