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:
@@ -1,5 +1,9 @@
|
||||
ALLOWED_LOCALES = /nl|de|fr|en|es/
|
||||
Mozo::Application.routes.draw do
|
||||
# ActionCable WebSocket endpoint (replaces Faye at events.mozo.bar/faye)
|
||||
# Clients connect via: wss://mozo.bar/cable?auth_token=TOKEN
|
||||
mount ActionCable.server => '/cable'
|
||||
|
||||
match '/.well-known/*rest', to: 'errors#not_found', via: :all
|
||||
match '/system/*rest', to: 'errors#not_found', via: :all
|
||||
devise_for :users, controllers: {
|
||||
|
||||
Reference in New Issue
Block a user