Class: WhereIsWaldo::RosterDelivery::Base

Inherits:
Object
  • Object
show all
Defined in:
app/services/where_is_waldo/roster_delivery.rb

Overview

Base contract. Channels call these; return values drive the channel's I/O.

Direct Known Subclasses

Broadcast, Fanout, Poll

Instance Method Summary collapse

Instance Method Details

#on_transition(_subject_id) ⇒ Object

Side effect on a presence transition (usually a broadcast). No return.



41
# File 'app/services/where_is_waldo/roster_delivery.rb', line 41

def on_transition(_subject_id); end

#poll_messages(_subject, _session_id) ⇒ Array<Hash>

Returns cable messages to transmit to the polling client.

Returns:

  • (Array<Hash>)

    cable messages to transmit to the polling client



36
37
38
# File 'app/services/where_is_waldo/roster_delivery.rb', line 36

def poll_messages(_subject, _session_id)
  []
end

#subscribe_plan(_subject, _session_id) ⇒ Hash

Returns { streams: [names], messages: [cable messages] }.

Returns:

  • (Hash)

    { streams: [names], messages: [cable messages] }



31
32
33
# File 'app/services/where_is_waldo/roster_delivery.rb', line 31

def subscribe_plan(_subject, _session_id)
  { streams: [], messages: [] }
end