Sha256: 384e0b9d7aaecb13daefefdfeee24991719dca6fcdc6e5b6e6b90222469a5e98

Contents?: true

Size: 381 Bytes

Versions: 1

Compression:

Stored size: 381 Bytes

Contents

require "net/http"
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "servent"
require "pp"

event_source = Servent::EventSource.new("http://localhost:9292/")
event_source.on_message do |event|
  if event.data == "close"
    puts "going to close this client"
    return event_source.close
  end

  puts "received: "+ event.data
end
event_source.listen

puts "bye"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
servent-0.1.0 examples/consumer.rb