Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Solid Cable adapter for ActionCable #1660

Open
wants to merge 1 commit into
base: rails_72
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ AllCops:
NewCops: enable
Exclude:
- 'bin/*'
- 'db/schema.rb'
- 'db/*schema.rb'
- 'vendor/**/*'
# Ignore local files for faster processing
- 'tmp/**/*'
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ gem 'sassc-rails'
gem 'shakapacker', '8.0.2'
gem 'simple_form'
gem 'slim-rails'
gem 'solid_cable'
gem 'solid_queue'
gem 'sprockets-rails'
gem 'terser', require: false
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@ GEM
rexml (~> 3.2)
rubocop (>= 1.0, < 2.0)
slim (>= 3.0, < 6.0)
solid_cable (2.0.2)
rails (>= 7.2)
solid_queue (0.7.1)
activejob (>= 7.1)
activerecord (>= 7.1)
Expand Down Expand Up @@ -666,6 +668,7 @@ DEPENDENCIES
simplecov
slim-rails
slim_lint
solid_cable
solid_queue
sprockets-rails
stackprof
Expand Down
23 changes: 18 additions & 5 deletions config/cable.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
default: &default
adapter: solid_cable # OR postgresql OR redis

### Config options for `solid_cable`
connects_to:
database:
writing: cable
polling_interval: 0.1.seconds
message_retention: 1.day
autotrim: true
silence_polling: true

### Config options for `redis`
# url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
# channel_prefix: codeharbor_production

development:
adapter: postgresql
<<: *default

test:
adapter: test

production:
adapter: postgresql # redis
# all other options below are only used for redis
# url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
# channel_prefix: codeharbor_production
<<: *default
18 changes: 14 additions & 4 deletions config/database.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ default: &default
<% end %>

development:
<<: *default
database: codeharbor_development
primary: &primary_development
<<: *default
database: codeharbor_development
cable:
<<: *primary_development
database: codeharbor_development_cable
migrations_paths: db/cable_migrate

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
Expand All @@ -56,5 +61,10 @@ test:
# for a full overview on how database connection configuration can be specified.
#
production:
<<: *default
database: codeharbor_production
primary: &primary_production
<<: *default
database: codeharbor_production
cable:
<<: *primary_production
database: codeharbor_production_cable
migrations_paths: db/cable_migrate
25 changes: 25 additions & 0 deletions db/cable_schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading