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 +4 -4
- data/.travis.yml +17 -3
- data/broadcaster.gemspec +2 -8
- data/lib/broadcaster.rb +13 -9
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90a6948f7efefca09f7a8dae08c85402844b7cdc
|
4
|
+
data.tar.gz: 27d4e8d9c47555c9b0a2e5153702eb96486e6a87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 201f6d54a4208e4c30456102d6bcd39bc07e5769976957eeee807372939e6d48cb66cbb6a7df3028ea25fc8b05af0a2aa7748b98a2a3d11ee1df40147e2f0ab9
|
7
|
+
data.tar.gz: ae3d206cee7a2517e48dd1af011ba8f7db7a2d6bebf2cd41bea69a75b27402a0a9da1ad15f32d0362a8a0928f72ad9648fb9c7426304c4a6c73902d008a7c8d5
|
data/.travis.yml
CHANGED
@@ -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
|
-
-
|
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
|
23
|
+
- rvm all-gemsets do gem uninstall bundler -ax || true
|
24
|
+
- gem install bundler -v "< 2"
|
25
|
+
|
12
26
|
services:
|
13
27
|
- redis-server
|
data/broadcaster.gemspec
CHANGED
@@ -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.
|
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
|
data/lib/broadcaster.rb
CHANGED
@@ -70,16 +70,20 @@ class Broadcaster
|
|
70
70
|
|
71
71
|
Thread.new do
|
72
72
|
loop do
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
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.
|
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:
|
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
|