Sha256: 4adf5d6f5b8af0f5bcbb1ee97782ed3245042741cca2a19a4e8f87125a9fa5ef

Contents?: true

Size: 514 Bytes

Versions: 1

Compression:

Stored size: 514 Bytes

Contents

module Rsift

  class Socket
  
    def self.perform(stream_identifier)
      endpoint = "ws://stream.datasift.net:8080/"
      EventMachine.run {
        http = EventMachine::HttpRequest.new(
            "#{endpoint}#{stream_identifier}").get(:timeout => 0)
    
        http.callback { puts "Connected to rsift" }
        http.errback { puts "something has failed" }
        http.disconnect { puts "oops, dropped connection?" }
    
        http.stream { |msg|
          yield
        }
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rsift-0.3.2 lib/rsift/socket.rb