Created
September 2, 2013 08:24
-
-
Save kachayev/6410469 to your computer and use it in GitHub Desktop.
Push Notifications sending with #riak_pipe #Elixir #Pipes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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