msgr 0.11.1 → 0.12.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: cd577dc14c3fb4e5bfc6786ba513a5f5902a15de
4
- data.tar.gz: e4e5782f2e8cad01a34cb542b9c70bf1a0366dae
3
+ metadata.gz: af948cc7f2078a819fbe2994d84804502fb368c7
4
+ data.tar.gz: 44f61987e47d2a2bbae22cd21db176c15213f5cd
5
5
  SHA512:
6
- metadata.gz: aef657496482095e8dc3d24d65803a36b190f7c48104d998433b41f057a5dbc508905b39f54a92cf12fa77eb85e269e5ae45b46c5e1163cdbfcd0ac9616b15a7
7
- data.tar.gz: 88e1331b089dfa0e9e90dd7f24493ac8e4f2f151edb9865116bb68f2e114b24fc6dc9e8cee10df877203212b6f9e4cfd97f9c4a26c9fe7c0c969edf507233b52
6
+ metadata.gz: 588b61937371c0c0a28715c4a5883d94f54929f8e0c71d00883b3d575fac135bcd1280026586d88c9db1febfb000038d2d15bb6e82cb386783ff2dcf4a3ca4d4
7
+ data.tar.gz: dcb6e855d9f99ad771fed5ecf0b745c9e3eb7f6247fcb84d4f33a5ea6dd228a4de9f822d3fc98c0279598fceca7108a9c8eea75da8edb74662a230a5d1a4c53d
@@ -1,5 +1,3 @@
1
- require 'concurrent'
2
-
3
1
  module Msgr
4
2
 
5
3
  # The Dispatcher receives incoming messages,
@@ -12,10 +10,10 @@ module Msgr
12
10
  attr_reader :pool
13
11
 
14
12
  def initialize(config)
15
- config[:pool_class] ||= 'Concurrent::CachedThreadPool'
16
- log(:info) { "Initialize new dispatcher (#{config[:pool_class]} with #{config[:max]} threads)..." }
13
+ config[:pool_class] ||= 'Msgr::Dispatcher::NullPool'
14
+ log(:info) { "Initialize new dispatcher (#{config[:pool_class]}: #{config})..." }
17
15
 
18
- @pool = config[:pool_class].constantize.new(max: config[:max])
16
+ @pool = config[:pool_class].constantize.new config
19
17
  end
20
18
 
21
19
  def call(message)
@@ -53,5 +51,14 @@ module Msgr
53
51
  def to_s
54
52
  self.class.name
55
53
  end
54
+
55
+ class NullPool
56
+ def initialize(*)
57
+ end
58
+
59
+ def post(*args)
60
+ yield(*args)
61
+ end
62
+ end
56
63
  end
57
64
  end
data/lib/msgr/version.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Msgr
2
2
  module VERSION
3
3
  MAJOR = 0
4
- MINOR = 11
5
- PATCH = 1
4
+ MINOR = 12
5
+ PATCH = 0
6
6
  STAGE = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
8
8
 
data/msgr.gemspec CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency 'activesupport'
22
22
  spec.add_dependency 'bunny', '~> 1.5'
23
- spec.add_dependency 'concurrent-ruby', '~> 0.7.0'
24
23
  spec.add_dependency 'multi_json'
25
24
 
26
25
  spec.add_development_dependency 'bundler', '~> 1.3'
@@ -35,7 +35,7 @@ describe Msgr::Dispatcher do
35
35
  let(:action) { -> { dispatcher.call message }}
36
36
 
37
37
  before do
38
- expect_any_instance_of(::Concurrent::CachedThreadPool).to receive(:post).and_return { |m, &block| block.call m}
38
+ expect_any_instance_of(::Msgr::Dispatcher::NullPool).to receive(:post).and_return { |m, &block| block.call m}
39
39
  expect_any_instance_of(DispatcherTestConsumer).to receive(:index)
40
40
  end
41
41
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.5'
41
- - !ruby/object:Gem::Dependency
42
- name: concurrent-ruby
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 0.7.0
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 0.7.0
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: multi_json
57
43
  requirement: !ruby/object:Gem::Requirement