lib/rsift/socket.rb in rsift-0.3.2 vs lib/rsift/socket.rb in rsift-0.3.3
- old
+ new
@@ -1,20 +1,22 @@
+require 'em-http'
+
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.callback { puts "Connected to datasift" }
http.errback { puts "something has failed" }
http.disconnect { puts "oops, dropped connection?" }
http.stream { |msg|
- yield
+ yield msg
}
}
end
end
end
\ No newline at end of file