-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add solid cable and solid queue (#1264)
* add solid cable * add solid queue
- Loading branch information
Showing
15 changed files
with
291 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
web: bin/rails server -p 3000 | ||
css: bin/rails dartsass:watch | ||
jobs: bin/jobs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require_relative "../config/environment" | ||
require "solid_queue/cli" | ||
|
||
SolidQueue::Cli.start(ARGV) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
# Async adapter only works within the same process, so for manually triggering cable updates from a console, | ||
# and seeing results in the browser, you must do so from the web console (running inside the dev process), | ||
# not a terminal started via bin/rails console! Add "console" to any action or any ERB template view | ||
# to make the web console appear. | ||
development: | ||
adapter: async | ||
adapter: solid_cable | ||
connects_to: | ||
database: | ||
writing: cable | ||
polling_interval: 0.1.seconds | ||
message_retention: 1.day | ||
|
||
test: | ||
adapter: test | ||
|
||
production: | ||
adapter: redis | ||
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> | ||
channel_prefix: pet_rescue_production | ||
adapter: solid_cable | ||
connects_to: | ||
database: | ||
writing: cable | ||
polling_interval: 0.1.seconds | ||
message_retention: 1.day |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
default: &default | ||
dispatchers: | ||
- polling_interval: 1 | ||
batch_size: 500 | ||
workers: | ||
- queues: "*" | ||
threads: 3 | ||
processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> | ||
polling_interval: 0.1 | ||
|
||
development: | ||
<<: *default | ||
|
||
test: | ||
<<: *default | ||
|
||
production: | ||
<<: *default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# production: | ||
# periodic_cleanup: | ||
# class: CleanSoftDeletedRecordsJob | ||
# queue: background | ||
# args: [ 1000, { batch_size: 500 } ] | ||
# schedule: every hour | ||
# periodic_command: | ||
# command: "SoftDeletedRecord.due.delete_all" | ||
# priority: 2 | ||
# schedule: at 5am every day |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 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.0].define(version: 1) do | ||
# These are extensions that must be enabled in order to support this database | ||
enable_extension "pg_catalog.plpgsql" | ||
|
||
create_table "solid_cable_messages", force: :cascade do |t| | ||
t.binary "channel", null: false | ||
t.binary "payload", null: false | ||
t.datetime "created_at", null: false | ||
t.bigint "channel_hash", 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 |
Empty file.
Oops, something went wrong.