deepstream 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/deepstream.gemspec +1 -1
- data/lib/deepstream.rb +14 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c99b2702bcc1dda54eb10ab98c2cc2483779dbb1
|
4
|
+
data.tar.gz: d9a9d571cec27dc502ab83c94001b8bd6e4b0bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a8d350b3d9079c48834328bc45e29f3518048864e339d1864f22f076029a57124715822d478461472c71bb7611a1991afa5c63f052ab30c43a9b2a664625c90
|
7
|
+
data.tar.gz: da05c393f30fba40c5f08e5156e689c0b0c965a9209fafe4553a28c116a12de3d97d9c2003e702049d019585476e12c613bc73081c52bfd8d63e6b65ac0a5fbc
|
data/deepstream.gemspec
CHANGED
data/lib/deepstream.rb
CHANGED
@@ -56,6 +56,10 @@ class Deepstream::Record
|
|
56
56
|
@data[name] || @data[name[-1]]
|
57
57
|
end
|
58
58
|
end
|
59
|
+
|
60
|
+
def inspect
|
61
|
+
"Deepstream::Record (#{@version}) #{@name} #{@data.to_h}"
|
62
|
+
end
|
59
63
|
end
|
60
64
|
|
61
65
|
class Deepstream::List < Deepstream::Record
|
@@ -84,7 +88,7 @@ class Deepstream::List < Deepstream::Record
|
|
84
88
|
end
|
85
89
|
|
86
90
|
def all
|
87
|
-
@data.map { |x| @client.
|
91
|
+
@data.map { |x| @client.get_record(x) }
|
88
92
|
end
|
89
93
|
|
90
94
|
def keys
|
@@ -94,6 +98,10 @@ class Deepstream::List < Deepstream::Record
|
|
94
98
|
def set(*args)
|
95
99
|
fail 'cannot use set on a list'
|
96
100
|
end
|
101
|
+
|
102
|
+
def inspect
|
103
|
+
"Deepstream::List (#{@version}) #{@name} keys: #{@data}"
|
104
|
+
end
|
97
105
|
end
|
98
106
|
|
99
107
|
class Deepstream::Client
|
@@ -135,7 +143,7 @@ class Deepstream::Client
|
|
135
143
|
@timeout = 1
|
136
144
|
begin
|
137
145
|
_process_msg(_read_socket(timeout: 10))
|
138
|
-
rescue TimeoutError
|
146
|
+
rescue Timeout::TimeoutError
|
139
147
|
_write("heartbeat") # send anything to check if deepstream responds
|
140
148
|
_process_msg(_read_socket(timeout: 10))
|
141
149
|
end
|
@@ -292,4 +300,8 @@ class Deepstream::Client
|
|
292
300
|
else JSON.parse(payload, object_class: OpenStruct)
|
293
301
|
end
|
294
302
|
end
|
303
|
+
|
304
|
+
def inspect
|
305
|
+
"Deepstream::Client #{@address}:#{@port} connected: #{@connected}"
|
306
|
+
end
|
295
307
|
end
|