Sha256: aaaf627efa9afedf28c73a1375cf71b882ddbc42afa3d56cb1246826fa41d1e9
Contents?: true
Size: 606 Bytes
Versions: 125
Compression:
Stored size: 606 Bytes
Contents
require 'rubygems' require 'pusher' require 'eventmachine' require 'em-http-request' # To get these values: # - Go to https://app.pusherapp.com/ # - Click on Choose App. # - Click on one of your apps # - Click API Access Pusher.app_id = 'your_app_id' Pusher.key = 'your_key' Pusher.secret = 'your_secret' EM.run { deferrable = Pusher['test_channel'].trigger_async('my_event', 'hi') deferrable.callback { # called on success puts "Message sent successfully." EM.stop } deferrable.errback { |error| # called on error puts "Message could not be sent." puts error EM.stop } }
Version data entries
125 entries across 125 versions & 2 rubygems