AnyCable v0.6.0 Release Notes

Release Date: 2018-11-15 // over 5 years ago
  • πŸ’Ž RubyConf 2018 special.

    tl;dr anycable CLI; redis gem is no longer a runtime dependency (but still required for Redis broadcast adapter); health checkers; middlewares support and more flexible configuration.

    πŸ“š πŸ“ Check out a new documentation website.

    πŸ”‹ Features

    CLI

    AnyCable now ships with a CLI–anycable.

    πŸ‘‰ Use it to run a gRPC server:

    # run anycable and load app from app.rbbundle exec anycable -r app.rb# orbundle exec anycable --require app.rb
    

    πŸ‘€ All configuration options are also supported as CLI options (see anycable -h for more information).

    The only required options is the application file to load (-r/--require).

    πŸš… You can omit it if you want to load an app form ./config/environment.rb (e.g. with Rails) or ./config/anycable.rb.

    AnyCable CLI also allows you to run a separate command (process) from within a RPC server:

    $ bundle exec anycable --server-command "anycable-go -p 3334"
    

    πŸ”§ Configuration

    • 0️⃣ Default server host is changed from localhost:50051 to 0.0.0.0:50051
    • πŸ”¦ Expose gRPC server parameters via rpc_* config params:

      AnyCable.configure do |config| config.rpc_pool_size = 120 config.rpc_max_waiting_requests = 10# etcend

    • 0️⃣ REDIS_URL env is used by default if present (and no ANYCABLE_REDIS_URL specified)

    • πŸ”§ Make HTTP health check url configurable

    • βž• Add ability to pass Redis Sentinel config as array of string.

    πŸ”§ Now it's possible to pass Sentinel configuration via env vars:

    ANYCABLE\_REDIS\_SENTINELS=127.0.0.1:26380,127.0.0.1:26381 bundle exec anycable
    

    Broadcast adapters

    0️⃣ AnyCable allows you to use custom broadcasting adapters (Redis is used by default):

    # Specify by name (tries to load `AnyCable::BroadcastAdapters::MyAdapter` from# "anycable/broadcast\_adapters/my\_adapter")AnyCable.broadcast\_adapter = :my\_adapter, { option: "value" }# or provide an instance (should respond\_to #broadcast)AnyCable.broadcast\_adapter = MyAdapter.new
    

    πŸ’₯ Breaking: to use Redis adapter you must ensure that it is present in your Gemfile; AnyCable gem doesn't have redis as a dependency anymore.

    Other

    • βž• Added middlewares support

    πŸ‘€ See docs.

    • βž• Added gRPC health checker.

    πŸ‘€ See docs.

    πŸ”„ Changes

    NOTE : the old API is still working but deprecated (you'll see a notice).

    πŸ‘‰ Use AnyCable instead of Anycable

    πŸ†• New API for registering error handlers:

    AnyCable.capture\_exception do |ex| Honeybadger.notify(ex)end
    
    • 🚚 AnyCable::Server.start is deprecated and will be removed in the next version