spider-gazelle 3.1.1 → 3.2.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
- SHA1:
3
- metadata.gz: 4f4d29b114761056e2099b117fa2f4f9306e6887
4
- data.tar.gz: d564f1d4abba88eb4dc4fd5871384459928da8ff
2
+ SHA256:
3
+ metadata.gz: 380532205550af21f6b8b16a78fe41cbaa65741c393ec71507308001a92c8573
4
+ data.tar.gz: 708b2cb9805e71c81ac0f67e9f50f893dd58577d6101f902f9baa884536dbb50
5
5
  SHA512:
6
- metadata.gz: aa895bed229dbd1adaec96f2123a3194b841d31bd384147cc0ad4f4b62fc9803b88134c3a4c0200e4ab2fd5b189760827650bc9f9655162d615f1769e3bd9268
7
- data.tar.gz: 474b77d76fc56d15c755c6edae3cf0a7972095ca3d082613a727a42d9a56b6da667341561c94c19ee6115287c8af5d665e552abe2676202dad19925056f5164a
6
+ metadata.gz: baaedc7d50888f4112d036efab973d09bd0a9096a4685f758174d26079e7ef4ee0e0cc479fc6281af12745bac007473ad92f4ad98784966499fff17368a9e50c
7
+ data.tar.gz: a1ffabf0153e56ec6bfe4e90defa7e410a677e87b60b1a1bb618ae96dffa7f9dd26bba6874407df5a15b99eea180b3536148ebe9e6d2a710762fef9db4a93412
@@ -47,6 +47,7 @@ module SpiderGazelle
47
47
  @running = true
48
48
  @loaded = false
49
49
  @bound = false
50
+ @delay_port_binding = false
50
51
 
51
52
  @load_complete = @thread.defer
52
53
  end
@@ -71,7 +72,8 @@ module SpiderGazelle
71
72
 
72
73
  # This happends on the master thread so we don't need to check
73
74
  # for the shutdown events here
74
- bind_application_ports
75
+ @loaded = true
76
+ bind_application_ports unless @delay_port_binding
75
77
  else
76
78
  @logger.warn "A shutdown event occured while loading"
77
79
  perform_shutdown
@@ -84,7 +86,7 @@ module SpiderGazelle
84
86
 
85
87
  # Load gazelles and wait for the bindings to be sent
86
88
  def wait
87
-
89
+
88
90
  end
89
91
 
90
92
  # Pass existing bindings to the master process
@@ -110,6 +112,26 @@ module SpiderGazelle
110
112
  end
111
113
  end
112
114
 
115
+ def bind_application_ports
116
+ if @delay_port_binding && !@loaded
117
+ loaded.finally { bind_application_ports }
118
+ return
119
+ end
120
+ @bound = true
121
+
122
+ @options.each do |options|
123
+ @logger.verbose { "Loading rackup #{options}" }
124
+ iterator = @iterators[options[:mode]]
125
+
126
+ binding = @bindings[options[:port]] = Binding.new(iterator, options)
127
+ binding.bind
128
+ end
129
+ end
130
+
131
+ def delay_port_binding
132
+ @delay_port_binding = true
133
+ end
134
+
113
135
 
114
136
  protected
115
137
 
@@ -201,19 +223,6 @@ module SpiderGazelle
201
223
  end
202
224
  end
203
225
 
204
- def bind_application_ports
205
- @bound = true
206
- @loaded = true
207
-
208
- @options.each do |options|
209
- @logger.verbose { "Loading rackup #{options}" }
210
- iterator = @iterators[options[:mode]]
211
-
212
- binding = @bindings[options[:port]] = Binding.new(iterator, options)
213
- binding.bind
214
- end
215
- end
216
-
217
226
 
218
227
  # -------------------
219
228
  # Shutdown Management
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SpiderGazelle
4
- VERSION = '3.1.1'
4
+ VERSION = '3.2.0'
5
5
  EXEC_NAME = 'sg'
6
6
  end
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: 3.1.1
4
+ version: 3.2.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: 2017-11-28 00:00:00.000000000 Z
11
+ date: 2018-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-parser
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  requirements: []
197
197
  rubyforge_project:
198
- rubygems_version: 2.6.14
198
+ rubygems_version: 2.7.7
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: A fast, parallel and concurrent web server for ruby