Files
mozo-backend/config/cable.yml
T
root 1f52448253 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
2026-05-17 15:25:49 +02:00

19 lines
554 B
YAML

# 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