Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

gemfile to bootstrap the environment

  • Loading branch information...
commit 8062b8da5ecbb31f002469756fe2b91a8f49ec0a 1 parent 2586d44
@igrigorik authored
Showing with 87 additions and 12 deletions.
  1. +5 −0 Gemfile
  2. +63 −0 Gemfile.lock
  3. +2 −0  README.md
  4. +6 −3 lib/worker.rb
  5. +11 −9 router.rb
View
5 Gemfile
@@ -0,0 +1,5 @@
+source :rubygems
+
+gem 'goliath', :git => 'git://github.com/postrank-labs/goliath.git'
+gem 'spdy', :git => 'git://github.com/igrigorik/spdy.git'
+gem 'em-zeromq', :git => 'git://github.com/andrewvc/em-zeromq.git'
View
63 Gemfile.lock
@@ -0,0 +1,63 @@
+GIT
+ remote: git://github.com/andrewvc/em-zeromq.git
+ revision: 0b19d683f9ee2894c28b11405d275331a2c51bbd
+ specs:
+ em-zeromq (0.2.1)
+ eventmachine (>= 1.0.0.beta.3)
+ ffi-rzmq (>= 0.7.2)
+
+GIT
+ remote: git://github.com/igrigorik/spdy.git
+ revision: a9288b06da812c39baa83b3113ede867e6eff423
+ specs:
+ spdy (0.0.2)
+ bindata
+ ffi-zlib
+
+GIT
+ remote: git://github.com/postrank-labs/goliath.git
+ revision: c879223db898e3aad9036c007f74b51e3fa963df
+ specs:
+ goliath (0.9.1)
+ async-rack
+ em-synchrony (>= 0.3.0.beta.1)
+ eventmachine (>= 1.0.0.beta.3)
+ http_parser.rb
+ log4r
+ multi_json
+ rack (>= 1.2.2)
+ rack-contrib
+ rack-respond_to
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ async-rack (0.5.1)
+ rack (~> 1.1)
+ bindata (1.3.1)
+ em-synchrony (0.3.0.beta.1)
+ eventmachine (>= 1.0.0.beta.1)
+ eventmachine (1.0.0.beta.3)
+ ffi (1.0.7)
+ rake (>= 0.8.7)
+ ffi-rzmq (0.7.2)
+ ffi-zlib (0.2.0)
+ ffi
+ http_parser.rb (0.5.1)
+ log4r (1.1.9)
+ multi_json (0.0.5)
+ rack (1.2.2)
+ rack-accept-media-types (0.9)
+ rack-contrib (1.1.0)
+ rack (>= 0.9.1)
+ rack-respond_to (0.9.8)
+ rack-accept-media-types (>= 0.6)
+ rake (0.8.7)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ em-zeromq!
+ goliath!
+ spdy!
2  README.md
@@ -18,6 +18,8 @@ All reverse proxy servers have a common pain point: they have to know which back
## Example
+ $> bundle install
+ $>
$> ruby hello.rb worker-1
$> ruby hello.rb worker-2
$>
View
9 lib/worker.rb
@@ -1,7 +1,10 @@
-$: << '/git/spdy/lib'
+require 'bundler'
+Bundler.require
-require 'ffi-rzmq'
-require 'spdy'
+# $: << '/git/spdy/lib'
+#
+# require 'ffi-rzmq'
+# require 'spdy'
class Worker
def initialize(opts = {})
View
20 router.rb
@@ -1,10 +1,13 @@
-$: << '/git/spdy/lib'
-$: << '/git/goliath/lib'
-$: << '/git/em-zeromq/lib'
+require 'bundler'
+Bundler.require
-require 'em-zeromq'
-require 'goliath'
-require 'spdy'
+# $: << '/git/spdy/lib'
+# $: << '/git/goliath/lib'
+# $: << '/git/em-zeromq/lib'
+#
+# require 'em-zeromq'
+# require 'goliath'
+# require 'spdy'
class Router < Goliath::API
@@ -70,9 +73,8 @@ def response(env)
proxy(env, fin.to_binary_s, true)
- # TODO: merge upstream Goliath return
- # Goliath::Connection::AsyncResponse
- nil
+ # don't send any response to client just yet
+ [nil, nil, nil]
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.