spider-gazelle 1.0.0.rc3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2363b13c6111e7a4df5fd28d780ec4adcf5d76ab
4
- data.tar.gz: c0e3e7e4da343f021cdda39e1a6a1fe829b6951a
3
+ metadata.gz: 6a7447a407b6297445d56cc9dc47021b598375af
4
+ data.tar.gz: 16285931940c9e329b8f24d58659eca23e329822
5
5
  SHA512:
6
- metadata.gz: 34856dafcf2b8e138b2299f40739ae6847886671bbb67101918d0b82e4d66cca77ea64d8c36f4a427d2cfc1b8c54615c1cbd88639fcc8ce6df76ec55f148d3c1
7
- data.tar.gz: 46ef37b2469b5dc3a69a7138e20af7895a1666c27c4659f9d4f7923e2662351aab45aba7d34daacdbb2d1801caaf41ad8156ead058e81190637dc12cd82cd636
6
+ metadata.gz: 5d4fbb8493cd111f15fbfe6f6d718aa3afac4ddc13f3ce6d952c6b13cb1c0343e700db29197594f8364a3caea933141341584603ffa1bbc91dbf1faee01972d6
7
+ data.tar.gz: 46dbe2558d2678bf5aba39648cd8ac5fa64aa9c03b151cc2a4083484a1a3891ea5b9127d903e0519c1a6ae8b6b82443d64e1de3b6145915778a68733e794e8a7
data/bin/sg CHANGED
@@ -59,7 +59,7 @@ unless File.exists?(options[:rackup])
59
59
  abort "No rackup found at #{options[:rackup]}"
60
60
  end
61
61
 
62
- # Force process mode on Windows (pipes + sockets not working at the moment)
62
+ # Force process mode on Windows (sockets over pipes not working at the moment)
63
63
  ENV['SG_MODE'] = 'no_ipc' if ::FFI::Platform.windows?
64
64
 
65
65
  ::SpiderGazelle::Spider.run options[:rackup], options
@@ -1,7 +1,7 @@
1
- require "http-parser" # C based, fast, http parser
2
- require "libuv" # Ruby Libuv FFI wrapper
3
- require "rack" # Ruby webserver abstraction
4
- require "rack/lock_patch" # Single threaded in development mode
1
+ require "http-parser" # C based, fast, http parser
2
+ require "libuv" # Ruby Libuv FFI wrapper
3
+ require "rack" # Ruby webserver abstraction
4
+ require "rack/lock_patch" # Serialize execution in development mode
5
5
 
6
6
  require "spider-gazelle/request" # Holds request information and handles request processing
7
7
  require "spider-gazelle/connection" # Holds connection information and handles request pipelining
@@ -11,11 +11,12 @@ require "spider-gazelle/app_store" # Holds references to the loaded rack ap
11
11
  require "spider-gazelle/binding" # Holds a reference to a bound port and associated rack application
12
12
  require "spider-gazelle/spider" # Accepts connections and offloads them to gazelles
13
13
 
14
- require "spider-gazelle/upgrades/websocket" # Websocket implementation
14
+ # Reactor aware websocket implementation
15
+ require "spider-gazelle/upgrades/websocket"
15
16
 
16
17
  module SpiderGazelle
17
18
  # Delegate pipe used for passing sockets to the gazelles
18
- DELEGATE_PIPE = "/tmp/spider-gazelle.delegate"
19
+ DELEGATE_PIPE = ENV['SG_DELEGATE_PIPE'] || "/tmp/spider-gazelle.delegate"
19
20
  # Signal pipe used to pass control signals
20
- SIGNAL_PIPE = "/tmp/spider-gazelle.signal"
21
+ SIGNAL_PIPE = ENV['SG_SIGNAL_PIPE'] || "/tmp/spider-gazelle.signal"
21
22
  end
@@ -27,7 +27,7 @@ module SpiderGazelle
27
27
  # REMOTE_USER, or REMOTE_HOST parameters since those are either a security problem or
28
28
  # too taxing on performance.
29
29
  module Const
30
- SPIDER_GAZELLE_VERSION = VERSION = "1.0.0.rc3".freeze
30
+ SPIDER_GAZELLE_VERSION = VERSION = "1.0.0".freeze
31
31
  # CODE_NAME = "Earl of Sandwich Partition"
32
32
  SERVER = "SpiderGazelle".freeze
33
33
 
@@ -42,8 +42,6 @@ module SpiderGazelle
42
42
  server.loaded.then do
43
43
  puts "* Loading: #{app}"
44
44
 
45
- # yield server if block_given?
46
-
47
45
  caught = proc { |e| puts("#{e.message}\n#{e.backtrace.join("\n")}") unless e.backtrace.nil? }
48
46
  server.load(app, options).catch(caught)
49
47
  .finally { Process.kill('INT', 0) } # Terminate the application if the TCP binding is lost
@@ -87,13 +85,7 @@ module SpiderGazelle
87
85
  @gazelles_loaded = @web.defer
88
86
 
89
87
  # Start the server
90
- if @web.reactor_running?
91
- # Call run so we can be notified of errors
92
- @web.run &method(:reanimate)
93
- else
94
- # Don't block on this thread if default reactor not running
95
- Thread.new { @web.run(&method(:reanimate)) }
96
- end
88
+ reanimate
97
89
  end
98
90
 
99
91
  # Modes
@@ -238,7 +230,8 @@ module SpiderGazelle
238
230
  end
239
231
 
240
232
  # Triggers the creation of gazelles
241
- def reanimate(logger)
233
+ def reanimate
234
+
242
235
  # Manage the set of Gazelle socket listeners
243
236
  @threads = Set.new
244
237
 
@@ -261,9 +254,6 @@ module SpiderGazelle
261
254
  # Create a function for stopping the spider from another thread
262
255
  @signal_squash = @web.async @squash
263
256
 
264
- # Link up the loops logger
265
- logger.progress method(:log)
266
-
267
257
  if no_ipc?
268
258
  @gazelle = Gazelle.new @web, @logger, @mode
269
259
  @gazelle_count = 1
@@ -297,6 +287,8 @@ module SpiderGazelle
297
287
  # Signal gazelle death here
298
288
  @web.signal :INT, @squash
299
289
 
290
+ @wait = @web.async {}
291
+
300
292
  # Update state only once the event loop is ready
301
293
  @gazelles_loaded.promise
302
294
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_dependency 'rake'
22
22
  s.add_dependency 'http-parser' # Ruby FFI bindings for https://github.com/joyent/http-parser
23
- s.add_dependency 'libuv', '>= 0.12.4' # Ruby FFI bindings for https://github.com/joyent/libuv
23
+ s.add_dependency 'libuv', '>= 1.0.0' # Ruby FFI bindings for https://github.com/joyent/libuv
24
24
  s.add_dependency 'rack', '>= 1.0.0' # Ruby web server interface
25
25
  s.add_dependency 'websocket-driver' # Websocket parser
26
26
  s.add_dependency 'thread_safe' # Thread safe hashes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spider-gazelle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-04 00:00:00.000000000 Z
11
+ date: 2014-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.12.4
47
+ version: 1.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.12.4
54
+ version: 1.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rack
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -180,9 +180,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - '>'
183
+ - - '>='
184
184
  - !ruby/object:Gem::Version
185
- version: 1.3.1
185
+ version: '0'
186
186
  requirements: []
187
187
  rubyforge_project:
188
188
  rubygems_version: 2.1.11