Commit b610cb2
refactor(rails): introduce worker_thread harness hook for the hub-isolation example
The worker_hub_isolation shared example previously hard-coded
Thread.new for the two concurrent jobs it spawns. That works fine on
adapters that keep their queue state in-process (:test, :inline) but
some real adapters need per-thread setup (e.g. :solid_queue on SQLite
needs an isolated database per worker thread to avoid
SQLite3::BusyException).
Adds a `worker_thread(&block)` hook on the harness, defaulting to
`Thread.new(&block)`, and switches the shared example to call it.
Adapters that need extra worker setup override the hook.
Behaviour on :test (the only adapter on this branch) is unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 529d724 commit b610cb2
2 files changed
Lines changed: 10 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
72 | 80 | | |
0 commit comments