apnotic 1.0.0 → 1.0.1
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 +4 -4
- data/README.md +4 -0
- data/apnotic.gemspec +1 -1
- data/lib/apnotic/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82da596366fb53518eda9385937fcfb9e7fe476c
|
4
|
+
data.tar.gz: fea67c61a31550b9dcac35b0ed4db95dc3352a3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bf391d0311597c6c511fbac29c6918c83543edc977a6f05de8beac0e8633b3ae11ce7630c3859726dd0f8d677945a898119107564a41ba9967b22d5de1efa6a
|
7
|
+
data.tar.gz: 6695fc6cebfc5608fc2c3def9eb7fa54f6ab1404af333b7e9647b0619dd41624c298417e0c039202b2d1c9b8cab26a82751957bad455f01f660f57058fceef68
|
data/README.md
CHANGED
@@ -94,11 +94,14 @@ connection.close
|
|
94
94
|
|
95
95
|
|
96
96
|
### With Sidekiq / Rescue / ...
|
97
|
+
> In case that errors are encountered, Apnotic will repair the underlying connection but will not retry the requests that have failed. For this reason, it is recommended to use a queue engine that will retry unsuccessful pushes.
|
98
|
+
|
97
99
|
A practical usage of a Sidekiq / Rescue worker probably has to:
|
98
100
|
|
99
101
|
* Use a pool of persistent connections.
|
100
102
|
* Send a push notification.
|
101
103
|
* Remove a device with an invalid token.
|
104
|
+
* Raise errors when requests timeout, so that the queue engine can retry those.
|
102
105
|
|
103
106
|
An example of a Sidekiq worker with such features follows. This presumes a Rails environment, and a model `Device`.
|
104
107
|
|
@@ -121,6 +124,7 @@ class MyWorker
|
|
121
124
|
notification.alert = "Hello from Apnotic!"
|
122
125
|
|
123
126
|
response = connection.push(notification)
|
127
|
+
raise "Timeout sending a push notification" unless response
|
124
128
|
|
125
129
|
if response.status == '410' ||
|
126
130
|
(response.status == '400' && response.body['reason'] == 'BadDeviceToken')
|
data/apnotic.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "net-http2", ">= 0.
|
21
|
+
spec.add_dependency "net-http2", ">= 0.14", "< 2"
|
22
22
|
spec.add_dependency "connection_pool", "~> 2.0"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
data/lib/apnotic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apnotic
|
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
|
- Roberto Ostinelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-http2
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: '0.14'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '2'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: '0.14'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2'
|