sps-pub 0.5.1 → 0.5.2

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: df9a2382a120aaa956127440a62a084218673250
4
- data.tar.gz: cf014c230cc7d026100442d07ca24010b9fc2d64
3
+ metadata.gz: 5825cd5db8b2c21341cb9c810a90f3c1e638904e
4
+ data.tar.gz: a61713bbb68f00a4512246f498843ace9b19dcc0
5
5
  SHA512:
6
- metadata.gz: 6ec0946f1f36e59a0f9b17eee67da0474f40e77882c6176dc425f03035c76a417d0b5822ad8107e2cb7fb10fb53b6007ae3a8a349abc0942533eb01f65d212b0
7
- data.tar.gz: bf74107da79f0519f114b14007ede7fc4720331d4c6365898d14d0a6fa65367f400e0cc4d2e625047bb224dd51a35f6220a5bf1a1d91d2ead6718878d7d33b4f
6
+ metadata.gz: 6a980f9705d0f3511b768f339e52cdcb1d71216860449d430629dc3bb1cfa86b5deef7edafae9c06adf3cc4891e488d1c17b5be854699335a4fd05ce873d9311
7
+ data.tar.gz: 3f25f15a33a047a6ac9213ff49bcf03c8ca95437cf1279f2ecd492ea86b5d091742bac8befa2a2234404bc5ba6bc371994dc489ff1a26c9282dd55c5cc983f21
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/sps-pub.rb CHANGED
@@ -24,28 +24,31 @@ class SPSPub
24
24
  def self.notice(s, hostx='sps', host: hostx, address: host,
25
25
  port: '59000', retries: 3)
26
26
 
27
- retry_attempts = 0
28
27
 
29
- client = WebSocket::Client::Simple.connect "ws://%s:%s/" % [address, port]
30
- sleep 0.02
31
-
32
- begin
33
-
34
- client.send s
28
+ ws = WebSocket::Client::Simple.connect "ws://%s:%s/" % [address, port]
29
+
30
+ ws.on :open do
35
31
 
36
- rescue Errno::ETIMEDOUT => e
32
+ retry_attempts = 0
37
33
 
38
- if retries and retry_attempts < retries then
34
+ begin
39
35
 
40
- retries += 1
41
- puts 'SPSPub timeout retrying ...'
42
- retry
36
+ ws.send s
37
+
38
+ rescue Errno::ETIMEDOUT => e
39
+
40
+ if retries and retry_attempts < retries then
41
+
42
+ retries += 1
43
+ puts 'SPSPub timeout retrying ...'
44
+ retry
45
+
46
+ else
47
+ puts 'SPSPub timeout while trying to contact the host'
48
+ end
43
49
 
44
- else
45
- puts 'SPSPub timeout while trying to contact the host'
46
50
  end
47
-
48
- end
51
+ end
49
52
 
50
53
  :message_sent
51
54
 
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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  Ke//2Urv5XozW5nKniqR+yI7YVIlgDHWEjHdlCaQH3fMHsliDCeDF/lxRd902EDM
32
32
  pCvgnGqKZoDb7g==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-01-01 00:00:00.000000000 Z
34
+ date: 2017-01-02 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: websocket-client-simple
metadata.gz.sig CHANGED
Binary file