lib/restforce/concerns/streaming.rb
def faye
        unless options[:instance_url]
          raise 'Instance URL missing. Call .authenticate! first.'
        end

        url = "#{options[:instance_url]}/cometd/#{options[:api_version]}"

        @faye ||= Faye::Client.new(url).tap do |client|
          client.set_header 'Authorization', "OAuth #{options[:oauth_token]}"

          client.bind 'transport:down' do
            Restforce.log '[COMETD DOWN]'
            client.set_header 'Authorization', "OAuth #{authenticate!.access_token}"
          end

          client.bind 'transport:up' do
            Restforce.log '[COMETD UP]'
          end

          client.add_extension ReplayExtension.new(replay_handlers)
        end
      end
# Public: Faye client to use for subscribing to PushTopics
Faye client to use for subscribing to PushTopics
Faye client to use for subscribing to PushTopics
def faye
        unless options[:instance_url]
          raise 'Instance URL missing. Call .authenticate! first.'
        end
        url = "#{options[:instance_url]}/cometd/#{options[:api_version]}"
        @faye ||= Faye::Client.new(url).tap do |client|
          client.set_header 'Authorization', "OAuth #{options[:oauth_token]}"
          client.bind 'transport:down' do
            Restforce.log '[COMETD DOWN]'
            client.set_header 'Authorization', "OAuth #{authenticate!.access_token}"
          end
          client.bind 'transport:up' do
            Restforce.log '[COMETD UP]'
          end
          client.add_extension ReplayExtension.new(replay_handlers)
        end
      end
def faye unless options [ :instance_url ] raise 'Instance URL missing. Call .authenticate! first.' end url = "#{options[:instance_url]}/cometd/#{options[:api_version]}" @faye ||= Faye :: Client . new ( url ) . tap do | client | client . set_header 'Authorization' , "OAuth #{options[:oauth_token]}" client . bind 'transport:down' do Restforce . log '[COMETD DOWN]' client . set_header 'Authorization' , "OAuth #{authenticate!.access_token}" end client . bind 'transport:up' do Restforce . log '[COMETD UP]' end client . add_extension ReplayExtension . new ( replay_handlers ) end end
Public: Faye client to use for subscribing to PushTopics
Public : Faye client to use for subscribing to PushTopics