rpush 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/rpush/daemon/dispatcher/apns_tcp.rb +3 -1
- data/lib/rpush/daemon/tcp_connection.rb +16 -0
- data/lib/rpush/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0da1cac03ae3688486b3d3a35f9adf1aff283bed
|
4
|
+
data.tar.gz: 3710bfdf83a7fd76a790a42d4ee95278ed07f7e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e84ccee43191d9876c30f4df293299dc8c4d08de3ad96882aec3eb7fc0302217d32de0b1bede2faa296d686a9fa4c451ebb8a27a0560f664dcb5d578765465ae
|
7
|
+
data.tar.gz: 6cd9310c439cb97f8eab52456303d94b3c2c43872498a7c361f6343031b545476c2200707b1645f462de2b151fe585b6b476234edf7864a6875fe3c69a4156e6
|
data/CHANGELOG.md
CHANGED
@@ -23,7 +23,7 @@ module Rpush
|
|
23
23
|
super
|
24
24
|
@dispatch_mutex = Mutex.new
|
25
25
|
@stop_error_receiver = false
|
26
|
-
start_error_receiver
|
26
|
+
@connection.on_connect { start_error_receiver }
|
27
27
|
end
|
28
28
|
|
29
29
|
def dispatch(payload)
|
@@ -70,6 +70,8 @@ module Rpush
|
|
70
70
|
|
71
71
|
tuple = @connection.read(ERROR_TUPLE_BYTES)
|
72
72
|
@dispatch_mutex.synchronize { handle_error_response(tuple) }
|
73
|
+
rescue StandardError => e
|
74
|
+
log_error(e)
|
73
75
|
end
|
74
76
|
|
75
77
|
def handle_error_response(tuple)
|
@@ -26,13 +26,29 @@ module Rpush
|
|
26
26
|
@certificate = app.certificate
|
27
27
|
@password = app.password
|
28
28
|
@connected = false
|
29
|
+
@connection_callbacks = []
|
29
30
|
touch
|
30
31
|
end
|
31
32
|
|
33
|
+
def on_connect(&blk)
|
34
|
+
raise 'already connected' if @connected
|
35
|
+
@connection_callbacks << blk
|
36
|
+
end
|
37
|
+
|
32
38
|
def connect
|
33
39
|
@ssl_context = setup_ssl_context
|
34
40
|
@tcp_socket, @ssl_socket = connect_socket
|
35
41
|
@connected = true
|
42
|
+
|
43
|
+
@connection_callbacks.each do |blk|
|
44
|
+
begin
|
45
|
+
blk.call
|
46
|
+
rescue StandardError => e
|
47
|
+
log_error(e)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
@connection_callbacks.clear
|
36
52
|
end
|
37
53
|
|
38
54
|
def close
|
data/lib/rpush/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Leitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|