rpush 2.3.0-java → 2.3.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a29805b526b4e20790e6abfde8b1f4a2e13c820
4
- data.tar.gz: 3e4131f892b6bc9c8278670e3080e701a00b35df
3
+ metadata.gz: db242aa007028a120a9feda8864ac82fc80c03e8
4
+ data.tar.gz: a51af79635b86921dfc06805ec7b8bf0d22188c6
5
5
  SHA512:
6
- metadata.gz: d91934f23b29f4ff80bdd82efb28f86cadb534a2b464a721fae4ee2bc5b3a4929b21e6aca315880c02e5b779cc7a8acfe6bd1ac2c18de1872f94e80b62d5cd67
7
- data.tar.gz: e34e8a465a53826bbcb40cc7e83a00bb2b2d5f00fd477fb940d3fe4101636a8094bb9947087344af1204729dc5d86e018d941f158746a0213727da4292fefd33
6
+ metadata.gz: d6556717fa5851670234e1a105a12b7f3f04ef577e1a6f32ebd5433c96111e74fa12fedf62d554a456de36b3990efb6983b6a1068decc4e574225d897359cd25
7
+ data.tar.gz: 06c11662bf521575e6641b6cd6629206415203e629e34663fc2a5011aecd1ef4394c3ada86a351ba746906e9c1ca2ab6f4722dfbd51c57abcf8fa44a99a4dbca
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 2.3.1 (Jan 24, 2015)
2
+ * Fix CPU thrashing while waiting for an APNs connection be established (#119).
3
+
1
4
  ## 2.3.0 (Jan 19, 2015)
2
5
  * Add 'version' CLI command.
3
6
  * Rpush::Wpns::Notification now supports setting the 'data' attribute.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Rpush
2
- VERSION = '2.3.0'
2
+ VERSION = '2.3.1'
3
3
  end
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.0
4
+ version: 2.3.1
5
5
  platform: java
6
6
  authors:
7
7
  - Ian Leitch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-20 00:00:00.000000000 Z
11
+ date: 2015-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement