Add solid_cable

This commit is contained in:
Kevin McConnell
2025-01-03 16:20:36 +00:00
parent 50b803aab1
commit 648e9b2296
5 changed files with 54 additions and 9 deletions
+1
View File
@@ -14,6 +14,7 @@ gem "hotwire_combobox", github: "josefarias/hotwire_combobox", branch: :main
# Deployment and drivers
gem "bootsnap", require: false
gem "puma", ">= 5.0"
gem "solid_cable", ">= 3.0"
gem "sqlite3", ">= 2.0"
gem "thruster", require: false
+6
View File
@@ -313,6 +313,11 @@ GEM
sentry-ruby (5.22.1)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
solid_cable (3.0.5)
actioncable (>= 7.2)
activejob (>= 7.2)
activerecord (>= 7.2)
railties (>= 7.2)
sqlite3 (2.5.0-aarch64-linux-gnu)
sqlite3 (2.5.0-aarch64-linux-musl)
sqlite3 (2.5.0-arm-linux-gnu)
@@ -387,6 +392,7 @@ DEPENDENCIES
selenium-webdriver
sentry-rails
sentry-ruby
solid_cable (>= 3.0)
sqlite3 (>= 2.0)
stimulus-rails
thruster
+10 -5
View File
@@ -1,11 +1,16 @@
cable: &cable
adapter: solid_cable
connects_to:
database:
writing: cable
polling_interval: 0.1.seconds
message_retention: 1.day
development:
adapter: redis
url: redis://localhost:6379/1
<<: *cable
test:
adapter: test
production:
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: fizzy_production
<<: *cable
+14 -4
View File
@@ -10,8 +10,13 @@ default: &default
timeout: 5000
development:
<<: *default
database: storage/development.sqlite3
primary:
<<: *default
database: storage/development.sqlite3
cable:
<<: *default
database: storage/development_cable.sqlite3
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".
@@ -21,5 +26,10 @@ test:
database: storage/test.sqlite3
production:
<<: *default
database: storage/production.sqlite3
primary:
<<: *default
database: storage/production.sqlite3
cable:
<<: *default
database: storage/production_cable.sqlite3
migrations_paths: db/cable_migrate
+23
View File
@@ -0,0 +1,23 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.1].define(version: 1) do
create_table "solid_cable_messages", force: :cascade do |t|
t.binary "channel", limit: 1024, null: false
t.binary "payload", limit: 536870912, null: false
t.datetime "created_at", null: false
t.integer "channel_hash", limit: 8, null: false
t.index ["channel"], name: "index_solid_cable_messages_on_channel"
t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash"
t.index ["created_at"], name: "index_solid_cable_messages_on_created_at"
end
end