Skip to content

Instantly share code, notes, and snippets.

@marinho10
Created April 27, 2020 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marinho10/50121bccd2d2bf6fcb3c19c1c2029c35 to your computer and use it in GitHub Desktop.
Save marinho10/50121bccd2d2bf6fcb3c19c1c2029c35 to your computer and use it in GitHub Desktop.
def handle_info(:reschedule, state) do
Accounts.list_users()
|> Enum.map(fn %{id: id} ->
Absinthe.Subscription.publish(PhoenixAbsintheAuthenticatedSubscriptionsWeb.Endpoint, Enum.random(1..10),
accounts_user_count: "user_count:#{id}"
)
end)
schedule_user_worker()
{:noreply, state}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment