message_bus 2.0.0.beta.7 → 2.0.0.beta.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of message_bus might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 765d5f2c439f0bcc0ca030a838d93510ed638916
4
- data.tar.gz: 23a0428b2f62625e4063c066828d9fb5925a0a86
3
+ metadata.gz: 36e783040a809c36cf22fa4240a6c563c0b77445
4
+ data.tar.gz: 4c1912ddfd8af23adcab074d340094e32721528d
5
5
  SHA512:
6
- metadata.gz: 19127a42396bebe0d047fc7a3c41d7be908072711ef294e71d4f6546acd260b93520a4d0eb391d39b63253b5d6e057ee43aebaf7e032dd8f6cc6531352131001
7
- data.tar.gz: e863e48441974a73d3f956b9ba2cf01622bbc173ac5db435d3b0c1d38db0dab9b2b884d230cf50ab463ec225d323a73f4a7fd0299a033940074b5aaf29bb6583
6
+ metadata.gz: 7e4343488e590e4eb1270e2ba8c22b02d2e9b282be80fe79d606a8dce375ff90317abaccea16cf6f90350569a5be1e0daa1b9345f21253d522d42660091ff95c
7
+ data.tar.gz: 821d8f2fe45aef0dd014cc0315761e4b9bbc4eb47a0f8d67f5e323c8ebf302d7b8fc996bb01ad443f6f16ba1c1d5b421c92216eca85e31e8755618b645b889ce
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 27-04-2016
2
+
3
+ - Version 2.0.0.beta.7
4
+ - Fix: exception raised sometimes when subscribing at a particular position
5
+
1
6
  26-04-2016
2
7
 
3
8
  - Version 2.0.0.beta.7
data/Gemfile CHANGED
@@ -9,4 +9,5 @@ group :test do
9
9
  gem 'http_parser.rb'
10
10
  gem 'thin'
11
11
  gem 'rack-test', require: 'rack/test'
12
+ gem 'jasmine'
12
13
  end
data/README.md CHANGED
@@ -176,7 +176,7 @@ that of the JavaScript client.
176
176
 
177
177
  All client settings are settable via `MessageBus.OPTION`
178
178
 
179
- Setting|Default|
179
+ Setting|Default|Info
180
180
  ----|---|---|
181
181
  enableLongPolling|true|Allow long-polling (provided it is enable by the server)
182
182
  callbackInterval|15000|Safeguard to ensure background polling does not exceed this interval (in milliseconds)
@@ -1,7 +1,23 @@
1
+ -- wrk returns lots of read errors, this is unavoidable cause
2
+ --
3
+ -- 1. There is no internal implmentation of chunked encoding in wrk (which would be ideal)
4
+ --
5
+ -- 2. MessageBus gem does not provide http keepalive (by design), and can not provide content length
6
+ -- if MessageBus provided keepalive it would have to be able to redispatch the reqs to rack, something
7
+ -- that is not supported by the underlying rack hijack protocol, once a req is hijacked it can not be
8
+ -- returned
9
+ --
10
+ -- This leads to certain read errors while the bench runs cause wrk can not figure out cleanly that
11
+ -- MessageBus is done with a request
12
+ --
13
+
1
14
  wrk.method = "POST"
2
15
  wrk.body = ""
3
16
  wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"
4
- wrk.headers["Connection"] = "keep-alive"
17
+
18
+ -- chunking is not supported internally to wrk
19
+ wrk.headers["Dont-Chunk"] = "true"
20
+ wrk.headers["Connection"] = "Close"
5
21
 
6
22
  request = function()
7
23
  local hexdict = {48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102}
@@ -1,3 +1,5 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
2
+
1
3
  require 'message_bus'
2
4
  require 'stackprof'
3
5
 
data/lib/message_bus.rb CHANGED
@@ -403,7 +403,7 @@ module MessageBus::Implementation
403
403
  just_yield = true
404
404
  else
405
405
  current_id = replay_backlog(channel, current_id, site_id, &original_blk)
406
- if (current_id == m.id)
406
+ if (current_id == m.message_id)
407
407
  just_yield = true
408
408
  end
409
409
  end
@@ -1,3 +1,3 @@
1
1
  module MessageBus
2
- VERSION = "2.0.0.beta.7"
2
+ VERSION = "2.0.0.beta.8"
3
3
  end
data/message_bus.gemspec CHANGED
@@ -19,5 +19,4 @@ Gem::Specification.new do |gem|
19
19
  gem.add_runtime_dependency 'rack', '>= 1.1.3'
20
20
  gem.add_development_dependency 'redis'
21
21
  gem.add_development_dependency 'pg'
22
- gem.add_development_dependency 'jasmine'
23
22
  end
@@ -77,17 +77,7 @@ src_dir:
77
77
  #
78
78
  spec_dir: spec/assets
79
79
 
80
- # spec_helper
81
- #
82
- # Ruby file that Jasmine server will require before starting.
83
- # Returned relative to your root path
84
- # Default spec/javascripts/support/jasmine_helper.rb
85
- #
86
- # EXAMPLE:
87
- #
88
- # spec_helper: spec/javascripts/support/jasmine_helper.rb
89
- #
90
- # spec_helper: spec/javascripts/support/jasmine_helper.rb
80
+ spec_helper: spec/assets/support/jasmine_helper.rb
91
81
 
92
82
  # boot_dir
93
83
  #
@@ -0,0 +1,10 @@
1
+ Jasmine.configure do |config|
2
+ # patch for travis
3
+ if ENV['TRAVIS']
4
+ module ::Phantomjs
5
+ def self.version
6
+ @phantom_version ||= `phantomjs --version`.strip
7
+ end
8
+ end
9
+ end
10
+ end
@@ -23,6 +23,7 @@ describe MessageBus do
23
23
 
24
24
  data1 = []
25
25
  data2 = []
26
+ data3 = []
26
27
 
27
28
  @bus.subscribe("/minion") do |msg|
28
29
  data1 << msg.data
@@ -32,12 +33,20 @@ describe MessageBus do
32
33
  data2 << msg.data
33
34
  end
34
35
 
36
+ @bus.subscribe("/minion", 1) do |msg|
37
+ data3 << msg.data
38
+ end
39
+
35
40
  @bus.publish("/minion", "bananana")
41
+ @bus.publish("/minion", "it's so fluffy")
36
42
 
37
- wait_for(2000){ data2.length == 2 && data1.length == 1}
43
+ wait_for(2000) do
44
+ data3.length == 3 && data2.length == 3 && data1.length == 2
45
+ end
38
46
 
39
- data1.must_equal ['bananana']
40
- data2.must_equal ['banana', 'bananana']
47
+ data1.must_equal ['bananana', "it's so fluffy"]
48
+ data2.must_equal ['banana', 'bananana', "it's so fluffy"]
49
+ data3.must_equal ['banana', 'bananana', "it's so fluffy"]
41
50
  end
42
51
 
43
52
  it "can transmit client_ids" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message_bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta.7
4
+ version: 2.0.0.beta.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-26 00:00:00.000000000 Z
11
+ date: 2016-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: jasmine
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  description: A message bus for rack
70
56
  email:
71
57
  - sam.saffron@gmail.com
@@ -120,6 +106,7 @@ files:
120
106
  - spec/assets/SpecHelper.js
121
107
  - spec/assets/message-bus.spec.js
122
108
  - spec/assets/support/jasmine.yml
109
+ - spec/assets/support/jasmine_helper.rb
123
110
  - spec/lib/fake_async_middleware.rb
124
111
  - spec/lib/message_bus/assets/asset_encoding_spec.rb
125
112
  - spec/lib/message_bus/backends/postgres_spec.rb
@@ -161,6 +148,7 @@ test_files:
161
148
  - spec/assets/SpecHelper.js
162
149
  - spec/assets/message-bus.spec.js
163
150
  - spec/assets/support/jasmine.yml
151
+ - spec/assets/support/jasmine_helper.rb
164
152
  - spec/lib/fake_async_middleware.rb
165
153
  - spec/lib/message_bus/assets/asset_encoding_spec.rb
166
154
  - spec/lib/message_bus/backends/postgres_spec.rb