Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

README, client fixes

  • Loading branch information...
commit 3f78afc293e87aa8decb1475731b693cea50211e 1 parent 49e4318
@winton authored
View
4 README.md
@@ -1,8 +1,10 @@
Puggernaut
-===========
+==========
Simple server push implementation using eventmachine and long polling.
+![Puggernaut](http://cloud.github.com/downloads/winton/puggernaut/puggernaut.png)
+
Requirements
------------
View
23 lib/puggernaut/client.rb
@@ -1,26 +1,13 @@
module Puggernaut
class Client
- def initialize(env, servers)
+ def initialize(env='development', servers={})
Puggernaut.env = env
- loop do
- begin
- GC.start
- EM.epoll if EM.epoll?
- EM.run do
- @connections = servers.inject([]) do |array, (host, port)|
- logger.info "#{Time.now} Starting TCP client for #{host}:#{port}"
- array << EM.connect(host, port, Tcp)
- end
- end
- rescue Interrupt
- logger.info "#{Time.now} Shuting down client..."
- exit
- rescue
- logger.error "#{Time.now} Error: " + $!.message
- logger.error "\t" + $!.backtrace.join("\n\t")
- end
+ EM.epoll if EM.epoll?
+ @connections = servers.inject([]) do |array, (host, port)|
+ logger.info "#{Time.now} Starting TCP client for #{host}:#{port}"
+ array << EM.connect(host, port, Tcp)
end
end
View
2  lib/puggernaut/client/tcp.rb
@@ -24,7 +24,7 @@ def say(messages)
end
def send_data(data)
- callback{ super(data) }
+ callback { super(data) }
end
def unbind
Please sign in to comment.
Something went wrong with that request. Please try again.