sps-pub 0.4.1 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efa4841862710fef6c82821d559abb32eefaf6bf
4
- data.tar.gz: 2dc0d0afa3fc05b283a4e73fd058909947da730b
3
+ metadata.gz: 6ebc344417b378aded8289a69f8f31ec3335ae72
4
+ data.tar.gz: dada4b78af3af6e3924410993ad782f416a81ba4
5
5
  SHA512:
6
- metadata.gz: 13cf783375643cd757f40cacc3dfb19bcc1daf0ee2ddfe59f50729659f57e407723259cd050bfbaf8d85f2285ee888b797d4e248ab1678c4298aa8cede1554a8
7
- data.tar.gz: 0b60d4f5e4ec377506b9425523c3fdafdda0706bad801950b33190839016d683cbd2e7f5c3453436d72e031f8d5f9e9e6882c0a8e7bf74f15a2a6d8fa0c7cfb9
6
+ metadata.gz: 726066168133a30ed79e8cf0867ff793ac7dc5229b3752564f4f1c67b47447a36176631b66c256a5dc4d37026e377140aea300e22410333ba503309c95f65759
7
+ data.tar.gz: 6fee716949cc77f617fea34f8ced4d6c3335bb8b8cf938f75856ce9c2dcda335294b3088b3dc9bdd1a7f4eda2b0be3104273351183e1eb4067ec2d7ee3b991b7
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/sps-pub.rb CHANGED
@@ -17,10 +17,31 @@ class SPSPub
17
17
 
18
18
  alias publish notice
19
19
 
20
- def self.notice(s, host='sps', address: host, port: '59000')
20
+ def self.notice(s, host='sps', address: host, port: '59000', retries: 3)
21
+
22
+ retry_attempts = 0
23
+ client = Net::WS.new "ws://%s:%s/" % [host, port]
24
+
25
+ begin
26
+
27
+ client.send s
28
+
29
+ rescue Errno::ETIMEDOUT => e
30
+
31
+ if retries and retry_attempts < retries then
32
+
33
+ retries += 1
34
+ puts 'SPSPub timeout retrying ...'
35
+ retry
36
+
37
+ else
38
+ puts 'SPSPub timeout while trying to contact the host'
39
+ end
40
+
41
+ end
42
+
43
+ :message_sent
21
44
 
22
- client = Net::WS.new "ws://%s:%s/" % [host, port]
23
- client.send s
24
45
  end
25
46
 
26
47
  def self.pub(s, address: 'sps', port: '59000')
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sps-pub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  lT+QKN4YL+1lu8YyhGAGcseECGWVFHn6ID0opcTHsJRrpNxb/+ddlPzkT4H+hfuP
32
32
  TE5MmWrlPEJ9zA==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-10-07 00:00:00.000000000 Z
34
+ date: 2015-11-18 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: simpleblockingwebsocketclient
metadata.gz.sig CHANGED
Binary file