Module: WhereIsWaldo::RosterDelivery

Defined in:
app/services/where_is_waldo/roster_delivery.rb

Overview

Pluggable roster delivery strategies. Each app picks a mode per account (via config.roster_mode); the channels dispatch to the matching strategy. The data model (aggregation) and the wire message shapes are shared across all modes — only the transport/trigger differs, so the client reducer never forks.

Strategies are pure/stateless (any state lives in Rails.cache): they COMPUTE streams + messages and perform cache/broadcast side effects, but the channel owns the actual ActionCable transmit/stream_from.

Defined Under Namespace

Classes: Base, Broadcast, Fanout, Nudge, Poll

Class Method Summary collapse

Class Method Details

.for(mode) ⇒ Object

Resolve a strategy instance for a mode symbol.



17
18
19
20
21
22
23
24
25
26
# File 'app/services/where_is_waldo/roster_delivery.rb', line 17

def for(mode)
  case mode.to_sym
  when :broadcast then Broadcast.new
  when :poll then Poll.new
  when :nudge then Nudge.new
  when :fanout then Fanout.new
  else
    raise ArgumentError, "Unknown roster_mode: #{mode.inspect}"
  end
end