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 +4 -4
- data/bin/sg +1 -1
- data/lib/spider-gazelle.rb +8 -7
- data/lib/spider-gazelle/const.rb +1 -1
- data/lib/spider-gazelle/spider.rb +5 -13
- data/spider-gazelle.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a7447a407b6297445d56cc9dc47021b598375af
|
4
|
+
data.tar.gz: 16285931940c9e329b8f24d58659eca23e329822
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 (
|
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
|
data/lib/spider-gazelle.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require "http-parser"
|
2
|
-
require "libuv"
|
3
|
-
require "rack"
|
4
|
-
require "rack/lock_patch" #
|
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
|
-
|
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
|
data/lib/spider-gazelle/const.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
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
|
data/spider-gazelle.gemspec
CHANGED
@@ -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.
|
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
|
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-
|
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.
|
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.
|
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:
|
185
|
+
version: '0'
|
186
186
|
requirements: []
|
187
187
|
rubyforge_project:
|
188
188
|
rubygems_version: 2.1.11
|