broadcaster 1.0.0 → 1.0.1

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: 1c5c98fb655b82035d2e992af50959f0b56fa15e
4
- data.tar.gz: 9d1ef5f6ca63be591b5842b0eaffd2ec43584a63
3
+ metadata.gz: 90a6948f7efefca09f7a8dae08c85402844b7cdc
4
+ data.tar.gz: 27d4e8d9c47555c9b0a2e5153702eb96486e6a87
5
5
  SHA512:
6
- metadata.gz: a67deec06630d753007c1d6757c1f57b159b8add84a6abe90e4c63f348409084bf3b8463f3f2ed098081897673cd63c44eb636258ae5bb880a14aa29e0d7e16e
7
- data.tar.gz: 91bbcf0c370d1f528f3c9c662dd2ee2593d5cc2a0855805116ebb9df40a4b2e7f4e708eddeb3c2afd2facb9e3388207722408ae208d209b44f3ba7cef0e635c9
6
+ metadata.gz: 201f6d54a4208e4c30456102d6bcd39bc07e5769976957eeee807372939e6d48cb66cbb6a7df3028ea25fc8b05af0a2aa7748b98a2a3d11ee1df40147e2f0ab9
7
+ data.tar.gz: ae3d206cee7a2517e48dd1af011ba8f7db7a2d6bebf2cd41bea69a75b27402a0a9da1ad15f32d0362a8a0928f72ad9648fb9c7426304c4a6c73902d008a7c8d5
@@ -1,13 +1,27 @@
1
1
  language: ruby
2
+
2
3
  rvm:
3
- - 1.9.3
4
4
  - 2.0
5
5
  - 2.1
6
6
  - 2.2
7
7
  - 2.3.0
8
8
  - 2.4.0
9
- - jruby
9
+ - 2.5.0
10
+ - 2.6.0
11
+ - jruby-9.1.17.0
12
+ - jruby-9.2.7.0
13
+ - ruby-head
14
+ - jruby-head
15
+
16
+ matrix:
17
+ fast_finish: true
18
+ allow_failures:
19
+ - rvm: ruby-head
20
+ - rvm: jruby-head
21
+
10
22
  before_install:
11
- - gem install bundler
23
+ - rvm all-gemsets do gem uninstall bundler -ax || true
24
+ - gem install bundler -v "< 2"
25
+
12
26
  services:
13
27
  - redis-server
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'broadcaster'
7
- spec.version = '1.0.0'
7
+ spec.version = '1.0.1'
8
8
  spec.authors = ['Gabriel Naiman']
9
9
  spec.email = ['gabynaiman@gmail.com']
10
10
  spec.summary = 'Broadcasting based on Redis PubSub'
@@ -22,16 +22,10 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency 'bundler', '~> 1.12'
24
24
  spec.add_development_dependency 'rake', '~> 11.0'
25
- spec.add_development_dependency 'minitest', '~> 5.0'
25
+ spec.add_development_dependency 'minitest', '~> 5.0', '< 5.11'
26
26
  spec.add_development_dependency 'minitest-colorin', '~> 0.1'
27
27
  spec.add_development_dependency 'minitest-line', '~> 0.6'
28
28
  spec.add_development_dependency 'simplecov', '~> 0.12'
29
29
  spec.add_development_dependency 'coveralls', '~> 0.8'
30
30
  spec.add_development_dependency 'pry-nav', '~> 0.2'
31
-
32
- if RUBY_VERSION < '2'
33
- spec.add_development_dependency 'term-ansicolor', '~> 1.3.0'
34
- spec.add_development_dependency 'tins', '~> 1.6.0'
35
- spec.add_development_dependency 'json', '~> 1.8'
36
- end
37
31
  end
@@ -70,16 +70,20 @@ class Broadcaster
70
70
 
71
71
  Thread.new do
72
72
  loop do
73
- notification = subscriber.client.read
74
- channel = notification[2]
75
- message = Marshal.load notification[3]
76
- logger.debug(self.class) { "Broadcasting (#{subscriptions[channel].count}) | #{channel} | #{message}" }
77
- subscriptions[channel].each do |subscription_id, block|
78
- begin
79
- block.call message
80
- rescue => ex
81
- logger.error(self.class) { "Failed | #{channel} | #{subscription_id} | #{message}\n#{ex.class}: #{ex.message}\n#{ex.backtrace.join("\n")}" }
73
+ begin
74
+ notification = subscriber.client.read
75
+ channel = notification[2]
76
+ message = Marshal.load notification[3]
77
+ logger.debug(self.class) { "Broadcasting (#{subscriptions[channel].count}) | #{channel} | #{message}" }
78
+ subscriptions[channel].each do |subscription_id, block|
79
+ begin
80
+ block.call message
81
+ rescue => ex
82
+ logger.error(self.class) { "Failed | #{channel} | #{subscription_id} | #{message}\n#{ex.class}: #{ex.message}\n#{ex.backtrace.join("\n")}" }
83
+ end
82
84
  end
85
+ rescue java.nio.channels.ClosedSelectorException
86
+ # JRuby - Safe closing thread
83
87
  end
84
88
  end
85
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: broadcaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-12 00:00:00.000000000 Z
11
+ date: 2019-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redic
@@ -73,6 +73,9 @@ dependencies:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '5.0'
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: '5.11'
76
79
  type: :development
77
80
  prerelease: false
78
81
  version_requirements: !ruby/object:Gem::Requirement
@@ -80,6 +83,9 @@ dependencies:
80
83
  - - "~>"
81
84
  - !ruby/object:Gem::Version
82
85
  version: '5.0'
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '5.11'
83
89
  - !ruby/object:Gem::Dependency
84
90
  name: minitest-colorin
85
91
  requirement: !ruby/object:Gem::Requirement