pubnub 3.5.6 → 3.5.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pubnub might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/examples/sub_and_unsub_1.rb +2 -1
- data/lib/pubnub/event.rb +15 -9
- data/lib/version.rb +1 -1
- data/pubnub.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a5b067a186ac8cad4a23dcc47f1fcd9b5946e74
|
4
|
+
data.tar.gz: 22198f7ac785f8f4acb8465b25e1f670ae24a625
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c7df9d63c3948aff1855fe8533431c75810002004be898fe52f22dbe1671ede92e98ccf593797cf0c80341435b3f468ac9ceb3b08ad243aa243b065c9278daa
|
7
|
+
data.tar.gz: c3934bc9abec0e243bb0ab18fbf32503f40f35d7f066df0d88130133efaf52bef08b88ea0b250025c7dc5c0171a1648de7b0b33d320b0cfee5131c1869a55db7
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.5.
|
1
|
+
3.5.7
|
data/examples/sub_and_unsub_1.rb
CHANGED
@@ -23,7 +23,8 @@ sleep(5)
|
|
23
23
|
puts("Subscribing on ch ping_3 via a CSV list of channels.")
|
24
24
|
|
25
25
|
## You can pass a string, or a CSV string of the new channel(s)
|
26
|
-
p.subscribe(:channel => "ping_3,a", :http_sync => false){ |envelope| puts "block 1: channel: #{envelope.channel}: #{envelope.message}" }
|
26
|
+
# p.subscribe(:channel => "ping_3,a", :http_sync => false){ |envelope| puts "block 1: channel: #{envelope.channel}: #{envelope.message}" }
|
27
|
+
p.subscribe(:channel => "ping_3", :http_sync => false){ |envelope| puts "block 1: channel: #{envelope.channel}: #{envelope.message}" }
|
27
28
|
sleep(3)
|
28
29
|
|
29
30
|
## You can also pass an array of channels to subscribe
|
data/lib/pubnub/event.rb
CHANGED
@@ -37,17 +37,23 @@ module Pubnub
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def start_event(app, count = 0)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
begin
|
41
|
+
if count <= app.env[:max_retries]
|
42
|
+
$logger.debug('Pubnub'){'Event#start_event | sending request'}
|
43
|
+
$logger.debug('Pubnub'){"Event#start_event | tt: #{@timetoken}; ctt #{app.env[:timetoken]}"}
|
44
|
+
@response = get_connection(app).request(uri(app))
|
45
|
+
end
|
45
46
|
|
46
|
-
|
47
|
+
error = response_error(@response, app)
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
49
|
+
if ![error].flatten.include?(:json) || count > app.env[:max_retries]
|
50
|
+
handle_response(@response, app, error)
|
51
|
+
else
|
52
|
+
start_event(app, count + 1)
|
53
|
+
end
|
54
|
+
rescue => e
|
55
|
+
$logger.error('Pubnub'){e}
|
56
|
+
$logger.error('Pubnub'){e.inspect}
|
51
57
|
start_event(app, count + 1)
|
52
58
|
end
|
53
59
|
end
|
data/lib/version.rb
CHANGED
data/pubnub.gemspec
CHANGED