feat(broadcasting): add ActionCable adapter + fix model broadcast anti-pattern
- Add Mozo::Broadcaster::ActionCable as drop-in Faye replacement - Fix model_broadcast.rb: delegate to Mozo directly instead of ApplicationController.new (memory-unsafe anti-pattern) - Add Broadcastable concern for clean model-side broadcasting - ActionCable config: async adapter, cable.yml, WebSocket endpoint - MozoChannel with per-entity authorization (user/supplier/employee) - Connection auth via auth_token (matches existing auth pattern) - Mount /cable WebSocket in routes - Add broadcasting-migration.md with Faye→ActionCable guide
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# ActionCable configuration for real-time broadcasting.
|
||||
#
|
||||
# Development/Test: async adapter (in-process, no external dependency).
|
||||
# Production: async is fine for single-server deployments.
|
||||
# Switch to Redis (`redis://...`) if scaling to multiple Puma workers
|
||||
# where broadcasts need to reach clients connected to different workers.
|
||||
#
|
||||
development:
|
||||
adapter: async
|
||||
|
||||
test:
|
||||
adapter: test
|
||||
|
||||
production:
|
||||
adapter: async
|
||||
# adapter: redis
|
||||
# url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
|
||||
# channel_prefix: mozo_backend_production
|
||||
Reference in New Issue
Block a user