Skip to content

Commit 8e69554

Browse files
committed
Update readme to talk about Action Cable if using in development with a database.
1 parent 520dfea commit 8e69554

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

README.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ For small projects, you can run Solid Queue on the same machine as your webserve
8080

8181
Calling `bin/rails solid_queue:install` will automatically add `config.solid_queue.connects_to = { database: { writing: :queue } }` to `config/environments/production.rb`. In order to use Solid Queue in other environments (such as development or staging), you'll need to add a similar configuration(s).
8282

83-
For example, if you're using Sqlite in development, update `database.yml` as follows:
83+
For example, if you're using SQLite in development, update `database.yml` as follows:
8484

85-
```yaml
85+
```diff
8686
development:
8787
primary:
8888
<<: *default
8989
database: storage/development.sqlite3
90-
queue:
91-
<<: *default
92-
database: storage/development_queue.sqlite3
93-
migrations_paths: db/queue_migrate
90+
+ queue:
91+
+ <<: *default
92+
+ database: storage/development_queue.sqlite3
93+
+ migrations_paths: db/queue_migrate
9494
```
9595

9696
Next, add the following to `development.rb`
@@ -101,7 +101,7 @@ Next, add the following to `development.rb`
101101
config.solid_queue.connects_to = {database: {writing: :queue}}
102102
```
103103

104-
Once you've added this, again run `db:prepare` to create the Solid Queue database and load the schema.
104+
Once you've added this, run `db:prepare` to create the Solid Queue database and load the schema.
105105

106106
Finally, in order for jobs to be processed, you'll need to have Solid Queue running. In Development, this can be done via the Puma plugin. In `puma.rb` update the following line:
107107

@@ -110,6 +110,34 @@ Finally, in order for jobs to be processed, you'll need to have Solid Queue runn
110110
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] || Rails.env.development?
111111
```
112112

113+
**Import Note about Action Cable**: If you use Action Cable (or anything dependent on Action Cable, such as Turbo Streams), you will need to also need to update it to use a database.
114+
115+
In `config/cable.yml`
116+
117+
```diff
118+
development:
119+
- adapter: async
120+
+ adapter: solid_cable
121+
+ connects_to:
122+
+ database:
123+
+ writing: cable
124+
+ polling_interval: 0.1.seconds
125+
+ message_retention: 1.day
126+
```
127+
128+
In `config/database.yml`
129+
130+
```diff
131+
development:
132+
primary:
133+
<<: *default
134+
database: storage/development.sqlite3
135+
+ cable:
136+
+ <<: *default
137+
+ database: storage/development_cable.sqlite3
138+
+ migrations_paths: db/cable_migrate
139+
```
140+
113141
### Single database configuration
114142

115143
Running Solid Queue in a separate database is recommended, but it's also possible to use one single database for both the app and the queue. Just follow these steps:

0 commit comments

Comments
 (0)