Sha256: ee273f7fab76a53dc0ff4c937537381387006b65a45dafc32142553be5415016
Contents?: true
Size: 917 Bytes
Versions: 13
Compression:
Stored size: 917 Bytes
Contents
require 'spacebunny' # Prerequisites: # - You have created a Live Stream named 'live_data' through the SpaceBunny's web interface. # - The Live Stream has, as sources, two devices' 'data' channel. # See our Getting Started [link] for a quick introduction to SpaceBunny's base concepts. # Once everything is set up go to Users section on SpaceBunny Web UI, select one user and click on 'Access Keys' # Pick or create one access key and copy 'Client' and 'Secret'. client = 'live_stream_key_client' secret = 'live_stream_key_secret' # Instantiate a Spacebunny::LiveStream (AMQP by default) client, providing the 'client' and 'secret' options. # Also provide tls: true to establish a tls-encrypted connection live = Spacebunny::LiveStream.new client: client, secret: secret, tls: true live.connect live.message_from_cache :live_data, ack: :auto, wait: true do |message| puts "Received: #{message.payload}" end
Version data entries
13 entries across 13 versions & 1 rubygems