Skip to content

Commit

Permalink
Revert "feat(PredictionsPubSub): immediately broadcast resets (#1796)"
Browse files Browse the repository at this point in the history
This reverts commit 1ef5817.
  • Loading branch information
thecristen committed Nov 22, 2023
1 parent 228e8a7 commit e566e76
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions apps/predictions/lib/predictions_pub_sub.ex
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,6 @@ defmodule Predictions.PredictionsPubSub do

def handle_info({event, predictions}, state) do
:ok = Store.update(event, predictions)

# The :reset event is usually the first to happen after the stream starts,
# but can happen at other points during the stream as well. For reset
# events, immediately update subscribers instead of waiting for the next
# broadcast interval
if event == :reset do
send(self(), :broadcast)
end

{:noreply, state}
end

Expand All @@ -128,8 +119,7 @@ defmodule Predictions.PredictionsPubSub do
{:noreply, new_state}
end

# find registrations for this filter from processes other than the indicated
# pid
# find registrations for this filter from processes other than the indicated pid
defp no_other_subscribers?(stream, pid_to_omit) do
registry_key = self()
pattern = {registry_key, :"$2", {:_, stream}}
Expand Down

0 comments on commit e566e76

Please sign in to comment.