Skip to content

Instantly share code, notes, and snippets.

@kachayev
Created September 2, 2013 08:24
Show Gist options
  • Select an option

  • Save kachayev/6410469 to your computer and use it in GitHub Desktop.

Select an option

Save kachayev/6410469 to your computer and use it in GitHub Desktop.
Push Notifications sending with #riak_pipe #Elixir #Pipes
import Pipes
# defservice Profile do ... end
# defservice Device do ... end
# defservice Push do ... end
send = pipe do
profile <- Profile.all &1
badge <- Profile.get_badge_size profile
device <- Device.sessions profile
if Device.token? device
Push.send device, badge, &2
end
send "Apikey::42", "Message sent from macro to application 42"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment