plezi 0.9.2 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +44 -31
- data/bin/plezi +3 -3
- data/lib/plezi.rb +21 -43
- data/lib/plezi/common/defer.rb +21 -0
- data/lib/plezi/common/dsl.rb +115 -91
- data/lib/plezi/common/redis.rb +44 -0
- data/lib/plezi/common/settings.rb +58 -0
- data/lib/plezi/handlers/controller_core.rb +132 -0
- data/lib/plezi/handlers/controller_magic.rb +85 -259
- data/lib/plezi/handlers/http_router.rb +139 -60
- data/lib/plezi/handlers/route.rb +9 -178
- data/lib/plezi/handlers/stubs.rb +2 -2
- data/lib/plezi/helpers/http_sender.rb +72 -0
- data/lib/plezi/helpers/magic_helpers.rb +12 -0
- data/lib/plezi/{server → helpers}/mime_types.rb +0 -0
- data/lib/plezi/version.rb +1 -1
- data/plezi.gemspec +3 -11
- data/resources/Gemfile +20 -21
- data/resources/controller.rb +2 -2
- data/resources/oauth_config.rb +1 -1
- data/resources/redis_config.rb +2 -0
- data/test/plezi_tests.rb +39 -46
- metadata +24 -33
- data/lib/plezi/common/logging.rb +0 -60
- data/lib/plezi/eventmachine/connection.rb +0 -190
- data/lib/plezi/eventmachine/em.rb +0 -98
- data/lib/plezi/eventmachine/io.rb +0 -272
- data/lib/plezi/eventmachine/protocol.rb +0 -54
- data/lib/plezi/eventmachine/queue.rb +0 -51
- data/lib/plezi/eventmachine/ssl_connection.rb +0 -144
- data/lib/plezi/eventmachine/timers.rb +0 -117
- data/lib/plezi/eventmachine/workers.rb +0 -33
- data/lib/plezi/handlers/http_echo.rb +0 -27
- data/lib/plezi/handlers/http_host.rb +0 -214
- data/lib/plezi/handlers/magic_helpers.rb +0 -32
- data/lib/plezi/server/http.rb +0 -129
- data/lib/plezi/server/http_protocol.rb +0 -319
- data/lib/plezi/server/http_request.rb +0 -146
- data/lib/plezi/server/http_response.rb +0 -319
- data/lib/plezi/server/websocket.rb +0 -251
- data/lib/plezi/server/websocket_client.rb +0 -178
- data/lib/plezi/server/ws_response.rb +0 -161
data/lib/plezi/handlers/stubs.rb
CHANGED
@@ -94,7 +94,7 @@ module Plezi
|
|
94
94
|
end
|
95
95
|
|
96
96
|
# called immediately after a WebSocket connection has been established.
|
97
|
-
def
|
97
|
+
def on_open
|
98
98
|
true
|
99
99
|
end
|
100
100
|
|
@@ -108,7 +108,7 @@ module Plezi
|
|
108
108
|
|
109
109
|
# called when a disconnect packet has been recieved or the connection has been cut
|
110
110
|
# (ISN'T called after a disconnect message has been sent).
|
111
|
-
def
|
111
|
+
def on_close
|
112
112
|
end
|
113
113
|
|
114
114
|
# a demo event method that recieves a broadcast from instance siblings.
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module Plezi
|
2
|
+
module Base
|
3
|
+
|
4
|
+
# Sends common basic HTTP responses.
|
5
|
+
module HTTPSender
|
6
|
+
module_function
|
7
|
+
|
8
|
+
######
|
9
|
+
## basic responses
|
10
|
+
## (error codes and static files)
|
11
|
+
|
12
|
+
# sends a response for an error code, rendering the relevent file (if exists).
|
13
|
+
def send_by_code request, response, code, headers = {}
|
14
|
+
begin
|
15
|
+
base_code_path = request.io[:params][:templates] || File.expand_path('.')
|
16
|
+
if defined?(::Slim) && Plezi.file_exists?(fn = File.join(base_code_path, "#{code}.html.slim"))
|
17
|
+
Plezi.cache_data fn, Slim::Template.new( fn ) unless Plezi.cached? fn
|
18
|
+
return send_raw_data request, response, Plezi.get_cached( fn ).render( self, request: request ), 'text/html', code, headers
|
19
|
+
elsif defined?(::Haml) && Plezi.file_exists?(fn = File.join(base_code_path, "#{code}.html.haml"))
|
20
|
+
Plezi.cache_data fn, Haml::Engine.new( IO.read( fn ) ) unless Plezi.cached? fn
|
21
|
+
return send_raw_data request, response, Plezi.get_cached( File.join(base_code_path, "#{code}.html.haml") ).render( self ), 'text/html', code, headers
|
22
|
+
elsif defined?(::ERB) && Plezi.file_exists?(fn = File.join(base_code_path, "#{code}.html.erb"))
|
23
|
+
return send_raw_data request, response, ERB.new( Plezi.load_file( fn ) ).result(binding), 'text/html', code, headers
|
24
|
+
elsif Plezi.file_exists?(fn = File.join(base_code_path, "#{code}.html"))
|
25
|
+
return send_file(request, response, fn, code, headers)
|
26
|
+
end
|
27
|
+
return true if send_raw_data(request, response, GRHttp::HTTPResponse::STATUS_CODES[code], 'text/plain', code, headers)
|
28
|
+
rescue Exception => e
|
29
|
+
Plezi.error e
|
30
|
+
end
|
31
|
+
false
|
32
|
+
end
|
33
|
+
|
34
|
+
# attempts to send a static file by the request path (using `send_file` and `send_raw_data`).
|
35
|
+
#
|
36
|
+
# returns true if data was sent.
|
37
|
+
def send_static_file request, response
|
38
|
+
root = request.io[:params][:root]
|
39
|
+
return false unless root
|
40
|
+
file_requested = request[:path].to_s.split('/')
|
41
|
+
unless file_requested.include? '..'
|
42
|
+
file_requested.shift
|
43
|
+
file_requested = File.join(root, *file_requested)
|
44
|
+
return true if send_file request, response, file_requested
|
45
|
+
return send_file request, response, File.join(file_requested, request.io[:params][:index_file])
|
46
|
+
end
|
47
|
+
false
|
48
|
+
end
|
49
|
+
|
50
|
+
# sends a file/cacheed data if it exists. otherwise returns false.
|
51
|
+
def send_file request, response, filename, status_code = 200, headers = {}
|
52
|
+
if Plezi.file_exists?(filename) && !::File.directory?(filename)
|
53
|
+
return send_raw_data request, response, Plezi.load_file(filename), MimeTypeHelper::MIME_DICTIONARY[::File.extname(filename)], status_code, headers
|
54
|
+
end
|
55
|
+
return false
|
56
|
+
end
|
57
|
+
# sends raw data through the connection. always returns true (data send).
|
58
|
+
def send_raw_data request, response, data, mime, status_code = 200, headers = {}
|
59
|
+
headers.each {|k, v| response[k] = v}
|
60
|
+
response.status = status_code
|
61
|
+
response['content-type'] = mime
|
62
|
+
response['cache-control'] ||= 'public, max-age=86400'
|
63
|
+
response << data
|
64
|
+
response['content-length'] = data.bytesize
|
65
|
+
true
|
66
|
+
end##########
|
67
|
+
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Plezi
|
2
|
+
|
3
|
+
module Base
|
4
|
+
module Helpers
|
5
|
+
# a proc that allows Hashes to search for key-value pairs while also converting keys from objects to symbols and from symbols to strings.
|
6
|
+
#
|
7
|
+
# (key type agnostic search Hash proc)
|
8
|
+
HASH_SYM_PROC = Proc.new {|h,k| k = (Symbol === k ? k.to_s : k.to_s.to_sym); h[k] if h.has_key?(k) }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
File without changes
|
data/lib/plezi/version.rb
CHANGED
data/plezi.gemspec
CHANGED
@@ -18,19 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_dependency "grhttp", "~> 0.0.6"
|
21
22
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
24
|
|
24
|
-
|
25
|
-
spec.post_install_message = "** Deprecation Warning:\n
|
26
|
-
V.0.10.0 will be a major revision. It will also change the Websocket API so that it conforms to the Javascript API, making it clearer.
|
27
|
-
|
28
|
-
Also, V. 0.10.0 will utilize the GReactor IO reactor and the GRHttp HTTP and Websocket server gems. Both are native Ruby, so no C or Java extentions should be introduced.
|
29
|
-
|
30
|
-
This means that asynchronous tasking will now be handled by GReactor's API.
|
31
|
-
|
32
|
-
Make sure to test your app before upgrading to the 0.10.0 version.
|
33
|
-
|
34
|
-
Thank you for installing Plezi, the native Ruby Framework for real time web-apps."
|
25
|
+
spec.post_install_message = "Thank you for installing Plezi, the native Ruby Framework for real time web-apps."
|
26
|
+
# spec.post_install_message = "** Deprecation Warning:\n\nThank you for installing Plezi, the native Ruby Framework for real time web-apps."
|
35
27
|
|
36
28
|
end
|
data/resources/Gemfile
CHANGED
@@ -8,15 +8,6 @@
|
|
8
8
|
## use rake tasks with bundle exec?
|
9
9
|
# gem 'rake'
|
10
10
|
|
11
|
-
## active support can run without rails and extends the Ruby language.
|
12
|
-
## it might be heavy, be warned.
|
13
|
-
## see: http://guides.rubyonrails.org/active_support_core_extensions.html
|
14
|
-
#
|
15
|
-
# gem 'activesupport', :require => ['active_support', 'active_support/core_ext']
|
16
|
-
## or:
|
17
|
-
# gem 'activesupport', :require => ['active_support', 'active_support/all']
|
18
|
-
|
19
|
-
|
20
11
|
####################
|
21
12
|
# gems for easy markup
|
22
13
|
|
@@ -26,29 +17,22 @@
|
|
26
17
|
## Sass makes CSS easy
|
27
18
|
# gem "sass"
|
28
19
|
|
29
|
-
## erb for HTML fanatics:
|
30
|
-
# gem 'erb'
|
31
|
-
|
32
20
|
## we love Haml, even though it can be slow:
|
33
21
|
# gem 'haml'
|
34
22
|
|
35
|
-
##
|
23
|
+
## Coffee Script makes Javascript more fun to code.
|
36
24
|
# gem "coffee-script"
|
37
25
|
|
38
26
|
####################
|
39
27
|
# Internationalization
|
40
28
|
|
41
|
-
## I18n is the only one I know of.
|
42
29
|
# gem 'i18n'
|
43
30
|
|
44
31
|
####################
|
45
32
|
# WebSocket Scaling
|
46
33
|
|
47
|
-
##
|
48
|
-
##
|
49
|
-
## the Controller#broadcast can be configured to automatically use Redis, but some inter-process limitation apply.
|
50
|
-
## using Redis, we can publish messages and subscribe to 'chunnels' across processes
|
51
|
-
## (limited support for :broadcast and NO support for :collect while Redis is running).
|
34
|
+
## Redis servers are used to allow websocket scaling.
|
35
|
+
## Plezi can be configured to automatically use Redis for easy scaling.
|
52
36
|
|
53
37
|
# gem 'redis'
|
54
38
|
|
@@ -62,21 +46,36 @@
|
|
62
46
|
|
63
47
|
## MongoDB is a very well known NoSQL DB
|
64
48
|
## https://github.com/mongodb/mongo-ruby-driver
|
49
|
+
#
|
65
50
|
# gem 'mongo'
|
51
|
+
#
|
66
52
|
## for a performance boost, the C extentions can be used (NOT JRuby - bson_ext isn't used with JRuby).
|
53
|
+
#
|
67
54
|
# gem 'bson_ext'
|
55
|
+
#
|
68
56
|
## you can also have a look at the Mongo Mapper ORM
|
69
57
|
## http://mongomapper.com
|
58
|
+
#
|
70
59
|
# gem 'mongo_mapper'
|
71
60
|
|
72
|
-
##
|
61
|
+
## Sequel:
|
73
62
|
## http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html
|
74
63
|
## http://sequel.jeremyevans.net/rdoc/files/doc/cheat_sheet_rdoc.html
|
75
64
|
## this seems greate, but we left out any auto-config for this one... seems to work out of the box.
|
65
|
+
#
|
76
66
|
# gem 'sequel'
|
77
67
|
|
78
68
|
## if you want to use ActiveRecord, uncomment the following line(s)...
|
79
69
|
## but first, please remember that AcriveRecord needs extra attention when multi-threading
|
80
70
|
# gem 'activerecord', :require => 'active_record'
|
81
71
|
# gem 'bcrypt', '~> 3.1.7'
|
82
|
-
# gem 'standalone_migrations' # will
|
72
|
+
# gem 'standalone_migrations' # will more rake tasks support for ActiveRecord
|
73
|
+
|
74
|
+
## active support can run without rails and extends the Ruby language.
|
75
|
+
## it could be heavy, be warned.
|
76
|
+
## see: http://guides.rubyonrails.org/active_support_core_extensions.html
|
77
|
+
#
|
78
|
+
# gem 'activesupport', :require => ['active_support', 'active_support/core_ext']
|
79
|
+
## or:
|
80
|
+
# gem 'activesupport', :require => ['active_support', 'active_support/all']
|
81
|
+
|
data/resources/controller.rb
CHANGED
@@ -107,7 +107,7 @@ class SampleController
|
|
107
107
|
end
|
108
108
|
|
109
109
|
# called immediately after a WebSocket connection has been established.
|
110
|
-
def
|
110
|
+
def on_open
|
111
111
|
# response.close
|
112
112
|
# false
|
113
113
|
end
|
@@ -125,7 +125,7 @@ class SampleController
|
|
125
125
|
|
126
126
|
# called when a disconnect packet has been recieved or the connection has been cut
|
127
127
|
# (ISN'T called after a disconnect message has been sent).
|
128
|
-
def
|
128
|
+
def on_close
|
129
129
|
end
|
130
130
|
|
131
131
|
# a demo event method that recieves a broadcast from instance siblings.
|
data/resources/oauth_config.rb
CHANGED
@@ -20,5 +20,5 @@
|
|
20
20
|
# create_auth_shared_route do |service_name, auth_token, remote_user_id, remote_user_email, remote_response|
|
21
21
|
# # ...callback for authentication.
|
22
22
|
# # This callback should return the app user object or false
|
23
|
-
# # This callback
|
23
|
+
# # This callback has access to the magic controller methods (request, cookies, etc')
|
24
24
|
# end
|
data/resources/redis_config.rb
CHANGED
data/test/plezi_tests.rb
CHANGED
@@ -81,8 +81,7 @@ class TestCtrl
|
|
81
81
|
end
|
82
82
|
# path to test for chuncked encoding and response streaming.
|
83
83
|
def streamer
|
84
|
-
response.
|
85
|
-
PL.callback(self, :_stream_out) { PL.callback(response, :finish) }
|
84
|
+
response.stream_async &method(:_stream_out)
|
86
85
|
true
|
87
86
|
end
|
88
87
|
def _stream_out
|
@@ -102,7 +101,7 @@ class TestCtrl
|
|
102
101
|
## WebSockets
|
103
102
|
|
104
103
|
# called once the websocket was connected
|
105
|
-
def
|
104
|
+
def on_open
|
106
105
|
response << "connected"
|
107
106
|
end
|
108
107
|
|
@@ -126,7 +125,7 @@ class TestCtrl
|
|
126
125
|
|
127
126
|
# called when a disconnect packet has been recieved or the connection has been cut
|
128
127
|
# (ISN'T called after a disconnect message has been sent).
|
129
|
-
def
|
128
|
+
def on_close
|
130
129
|
end
|
131
130
|
|
132
131
|
# a demo event method that recieves a broadcast from instance siblings.
|
@@ -243,54 +242,54 @@ module PleziTestTasks
|
|
243
242
|
def test_websocket
|
244
243
|
connection_test = broadcast_test = echo_test = unicast_test = false
|
245
244
|
begin
|
246
|
-
ws4 =
|
247
|
-
if
|
245
|
+
ws4 = GRHttp::WSClient.connect_to("wss://localhost:3030") do |ws|
|
246
|
+
if ws.data == "unicast"
|
248
247
|
puts " * Websocket unicast testing: #{RESULTS[false]}"
|
249
248
|
unicast_test = :failed
|
250
249
|
end
|
251
250
|
end
|
252
|
-
ws2 =
|
251
|
+
ws2 = GRHttp::WSClient.connect_to("wss://localhost:3030") do |ws|
|
253
252
|
next unless @is_connected || !(@is_connected = true)
|
254
|
-
if
|
253
|
+
if ws.data == "unicast"
|
255
254
|
puts " * Websocket unicast message test: #{RESULTS[false]}"
|
256
255
|
unicast_test = :failed
|
257
256
|
next
|
258
257
|
else
|
259
|
-
puts " * Websocket broadcast message test: #{RESULTS[broadcast_test = (
|
258
|
+
puts " * Websocket broadcast message test: #{RESULTS[broadcast_test = (ws.data == 'echo test')]}"
|
260
259
|
go_test = false
|
261
260
|
end
|
262
261
|
end
|
263
|
-
ws3 =
|
264
|
-
if
|
265
|
-
ws2 << "to: #{
|
266
|
-
puts " * Websocket UUID for unicast testing: #{
|
267
|
-
elsif
|
262
|
+
ws3 = GRHttp::WSClient.connect_to("ws://localhost:3000") do |ws|
|
263
|
+
if ws.data.match /uuid: ([^s]*)/
|
264
|
+
ws2 << "to: #{ws.data.match(/^uuid: ([^s]*)/)[1]}"
|
265
|
+
puts " * Websocket UUID for unicast testing: #{ws.data.match(/^uuid: ([^s]*)/)[1]}"
|
266
|
+
elsif ws.data == "unicast"
|
268
267
|
puts " * Websocket unicast testing: #{RESULTS[:waiting]}"
|
269
268
|
unicast_test ||= true
|
270
269
|
end
|
271
270
|
end
|
272
271
|
ws3 << 'get uuid'
|
273
272
|
puts " * Websocket SSL client test: #{RESULTS[ws2 && true]}"
|
274
|
-
ws1 =
|
273
|
+
ws1 = GRHttp::WSClient.connect_to("ws://localhost:3000") do |ws|
|
275
274
|
unless @connected
|
276
|
-
puts " * Websocket connection message test: #{RESULTS[connection_test = (
|
275
|
+
puts " * Websocket connection message test: #{RESULTS[connection_test = (ws.data == 'connected')]}"
|
277
276
|
@connected = true
|
278
277
|
response << "echo test"
|
279
278
|
next
|
280
279
|
end
|
281
|
-
if
|
280
|
+
if ws.data == "unicast"
|
282
281
|
puts " * Websocket unicast testing: #{RESULTS[false]}"
|
283
282
|
unicast_test = :failed
|
284
283
|
next
|
285
284
|
end
|
286
|
-
puts " * Websocket echo message test: #{RESULTS[echo_test = (
|
285
|
+
puts " * Websocket echo message test: #{RESULTS[echo_test = (ws.data == 'echo test')]}"
|
287
286
|
end
|
288
287
|
|
289
288
|
rescue => e
|
290
289
|
puts " **** Websocket tests FAILED TO RUN!!!"
|
291
290
|
puts e.message
|
292
291
|
end
|
293
|
-
remote =
|
292
|
+
remote = GRHttp::WSClient.connect_to("wss://echo.websocket.org/") {|ws| puts " * Extra Websocket Remote test (SSL: echo.websocket.org): #{RESULTS[ws.data == 'Hello websockets!']}"; response.close}
|
294
293
|
remote << "Hello websockets!"
|
295
294
|
sleep 0.5
|
296
295
|
[ws1, ws2, ws3, ws4, remote].each {|ws| ws.close}
|
@@ -301,23 +300,23 @@ module PleziTestTasks
|
|
301
300
|
end
|
302
301
|
def test_websocket_sizes
|
303
302
|
should_disconnect = false
|
304
|
-
ws =
|
303
|
+
ws = GRHttp::WSClient.connect_to("ws://localhost:3000/ws/size") do |ws|
|
305
304
|
if should_disconnect
|
306
305
|
puts " * Websocket size disconnection test: #{RESULTS[false]}"
|
307
306
|
else
|
308
|
-
puts " * Websocket message size test: got #{
|
307
|
+
puts " * Websocket message size test: got #{ws.data.bytesize} bytes"
|
309
308
|
end
|
310
309
|
|
311
310
|
end
|
312
|
-
ws.
|
311
|
+
ws.on_close do
|
313
312
|
puts " * Websocket size disconnection test: #{RESULTS[should_disconnect]}"
|
314
313
|
end
|
315
314
|
str = 'a'
|
316
315
|
time_now = Time.now
|
317
|
-
6.times {|i| str = str * 2**i;puts " * Websocket message size test: sending #{str.bytesize} bytes"; ws
|
316
|
+
6.times {|i| str = str * 2**i;puts " * Websocket message size test: sending #{str.bytesize} bytes"; ws << str; sleep 0.2 }
|
318
317
|
sleep (Time.now - time_now + 1)
|
319
318
|
should_disconnect = true
|
320
|
-
Plezi.ws_message_size_limit = 1024
|
319
|
+
Plezi::Settings.ws_message_size_limit = 1024
|
321
320
|
ws << str
|
322
321
|
end
|
323
322
|
def test_404
|
@@ -328,24 +327,24 @@ module PleziTestTasks
|
|
328
327
|
puts e
|
329
328
|
end
|
330
329
|
def test_500
|
331
|
-
workers =
|
332
|
-
print " * 500 internal error test: #{RESULTS[ Net::HTTP.get_response(URI.parse "http://localhost:3000/fail" ).code == '500' ]}"
|
333
|
-
# cause 10 more exceptions to be raised... testing thread survival.
|
334
|
-
10.times { putc "."; Net::HTTP.get_response(URI.parse "http://localhost:3000/fail" ).code }
|
335
|
-
putc "\n"
|
336
|
-
workers_after_test =
|
337
|
-
puts " * Worker survival test: #{RESULTS[workers_after_test == workers]} (#{workers_after_test} out of #{workers})"
|
338
|
-
|
339
|
-
rescue => e
|
340
|
-
puts " **** 500 internal error test FAILED TO RUN!!!"
|
341
|
-
puts e
|
330
|
+
# workers = GReactor.instance_exec {@threads.select {|t| t.alive?} .count}
|
331
|
+
# print " * 500 internal error test: #{RESULTS[ Net::HTTP.get_response(URI.parse "http://localhost:3000/fail" ).code == '500' ]}"
|
332
|
+
# # cause 10 more exceptions to be raised... testing thread survival.
|
333
|
+
# 10.times { putc "."; Net::HTTP.get_response(URI.parse "http://localhost:3000/fail" ).code }
|
334
|
+
# putc "\n"
|
335
|
+
# workers_after_test = GReactor.instance_exec {@threads.select {|t| t.alive?} .count}
|
336
|
+
# puts " * Worker survival test: #{RESULTS[workers_after_test == workers]} (#{workers_after_test} out of #{workers})"
|
337
|
+
|
338
|
+
# rescue => e
|
339
|
+
# puts " **** 500 internal error test FAILED TO RUN!!!"
|
340
|
+
# puts e
|
342
341
|
end
|
343
342
|
end
|
344
343
|
|
345
344
|
NO_PLEZI_AUTO_START = true
|
346
345
|
|
347
346
|
PL.create_logger '/dev/null'
|
348
|
-
# PL.max_threads = 4
|
347
|
+
# PL::Settings.max_threads = 4
|
349
348
|
|
350
349
|
listen port: 3000
|
351
350
|
|
@@ -359,7 +358,9 @@ shared_route '/some/:multi{path|another_path}/(:option){route|test}/(:id)/(:opti
|
|
359
358
|
shared_route '/', TestCtrl
|
360
359
|
|
361
360
|
|
362
|
-
|
361
|
+
GRHttp.start Plezi::Settings.max_threads
|
362
|
+
|
363
|
+
# start_services
|
363
364
|
|
364
365
|
shoutdown_test = false
|
365
366
|
Plezi.on_shutdown { shoutdown_test = true }
|
@@ -373,15 +374,7 @@ PleziTestTasks.run_tests
|
|
373
374
|
|
374
375
|
sleep PLEZI_TEST_TIME if defined? PLEZI_TEST_TIME
|
375
376
|
|
376
|
-
Plezi
|
377
|
-
puts "#{Plezi::EventMachine::EM_IO.count} connections awaiting shutdown."
|
378
|
-
Plezi::EventMachine.stop_connections
|
379
|
-
puts "#{Plezi::EventMachine::EM_IO.count} connections awaiting shutdown after connection close attempt."
|
380
|
-
if Plezi::EventMachine::EM_IO.count > 0
|
381
|
-
Plezi::EventMachine.forget_connections
|
382
|
-
puts "#{Plezi::EventMachine::EM_IO.count} connections awaiting shutdown after connections were forgotten."
|
383
|
-
end
|
384
|
-
Plezi::EventMachine.shutdown
|
377
|
+
Plezi.stop
|
385
378
|
|
386
379
|
|
387
380
|
puts " * Shutdown test: #{ PleziTestTasks::RESULTS[shoutdown_test] }"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plezi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
@@ -10,6 +10,20 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2015-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: grhttp
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.0.6
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.0.6
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,33 +70,20 @@ files:
|
|
56
70
|
- bin/plezi
|
57
71
|
- lib/plezi.rb
|
58
72
|
- lib/plezi/common/cache.rb
|
73
|
+
- lib/plezi/common/defer.rb
|
59
74
|
- lib/plezi/common/dsl.rb
|
60
|
-
- lib/plezi/common/
|
61
|
-
- lib/plezi/
|
62
|
-
- lib/plezi/
|
63
|
-
- lib/plezi/eventmachine/io.rb
|
64
|
-
- lib/plezi/eventmachine/protocol.rb
|
65
|
-
- lib/plezi/eventmachine/queue.rb
|
66
|
-
- lib/plezi/eventmachine/ssl_connection.rb
|
67
|
-
- lib/plezi/eventmachine/timers.rb
|
68
|
-
- lib/plezi/eventmachine/workers.rb
|
75
|
+
- lib/plezi/common/redis.rb
|
76
|
+
- lib/plezi/common/settings.rb
|
77
|
+
- lib/plezi/handlers/controller_core.rb
|
69
78
|
- lib/plezi/handlers/controller_magic.rb
|
70
|
-
- lib/plezi/handlers/http_echo.rb
|
71
|
-
- lib/plezi/handlers/http_host.rb
|
72
79
|
- lib/plezi/handlers/http_router.rb
|
73
|
-
- lib/plezi/handlers/magic_helpers.rb
|
74
80
|
- lib/plezi/handlers/route.rb
|
75
81
|
- lib/plezi/handlers/stubs.rb
|
82
|
+
- lib/plezi/helpers/http_sender.rb
|
83
|
+
- lib/plezi/helpers/magic_helpers.rb
|
84
|
+
- lib/plezi/helpers/mime_types.rb
|
76
85
|
- lib/plezi/oauth.rb
|
77
86
|
- lib/plezi/oauth/auth_controller.rb
|
78
|
-
- lib/plezi/server/http.rb
|
79
|
-
- lib/plezi/server/http_protocol.rb
|
80
|
-
- lib/plezi/server/http_request.rb
|
81
|
-
- lib/plezi/server/http_response.rb
|
82
|
-
- lib/plezi/server/mime_types.rb
|
83
|
-
- lib/plezi/server/websocket.rb
|
84
|
-
- lib/plezi/server/websocket_client.rb
|
85
|
-
- lib/plezi/server/ws_response.rb
|
86
87
|
- lib/plezi/version.rb
|
87
88
|
- plezi.gemspec
|
88
89
|
- resources/404.erb
|
@@ -118,18 +119,8 @@ homepage: http://boazsegev.github.io/plezi/
|
|
118
119
|
licenses:
|
119
120
|
- MIT
|
120
121
|
metadata: {}
|
121
|
-
post_install_message:
|
122
|
-
|
123
|
-
|
124
|
-
V.0.10.0 will be a major revision. It will also change the Websocket API so that it conforms to the Javascript API, making it clearer.
|
125
|
-
|
126
|
-
Also, V. 0.10.0 will utilize the GReactor IO reactor and the GRHttp HTTP and Websocket server gems. Both are native Ruby, so no C or Java extentions should be introduced.
|
127
|
-
|
128
|
-
This means that asynchronous tasking will now be handled by GReactor's API.
|
129
|
-
|
130
|
-
Make sure to test your app before upgrading to the 0.10.0 version.
|
131
|
-
|
132
|
-
Thank you for installing Plezi, the native Ruby Framework for real time web-apps.
|
122
|
+
post_install_message: Thank you for installing Plezi, the native Ruby Framework for
|
123
|
+
real time web-apps.
|
133
124
|
rdoc_options: []
|
134
125
|
require_paths:
|
135
126
|
- lib
|