deepstream 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -6
- data/deepstream.gemspec +1 -1
- data/lib/deepstream.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 415afac1b1b07ec3f6a7fce9e0c1909e44d65cd1
|
4
|
+
data.tar.gz: c50cc950cfab3fe1efc239ca7605e1e2540a1831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6353455636f5e9c28dbcb5e4b39ba7b054a88cf8f34a52ad4344d0a74b2fd587199c2f059bef82702009c004be812ff9f0149ae4a20cc9d9d446ddfde0bcaad8
|
7
|
+
data.tar.gz: dea8bc0022447c85fd444294062c0d0c561fe45e296ae5e1d5eade6b44eae4b62b0d32d6c6a0d2137effe905a8f70b0ed1377d914051f8eb58da62ce8dfeb6cf
|
data/README.md
CHANGED
@@ -2,13 +2,18 @@
|
|
2
2
|
deepstream.io ruby client
|
3
3
|
|
4
4
|
|
5
|
-
###
|
5
|
+
### Install
|
6
|
+
|
7
|
+
```
|
8
|
+
gem install deepstream
|
9
|
+
```
|
10
|
+
|
6
11
|
|
12
|
+
### Usage
|
7
13
|
```ruby
|
8
14
|
ds = Deepstream::Client.new('localhost')
|
9
15
|
|
10
16
|
# Emit events
|
11
|
-
|
12
17
|
ds.emit 'my_event'
|
13
18
|
# or
|
14
19
|
ds.emit 'my_event', foo: 'bar', bar: 'foo'
|
@@ -20,7 +25,7 @@ ds.on('some_event') do |msg|
|
|
20
25
|
end
|
21
26
|
|
22
27
|
|
23
|
-
# Get
|
28
|
+
# Get a record
|
24
29
|
foo = ds.get('foo')
|
25
30
|
|
26
31
|
# Update record
|
@@ -28,7 +33,5 @@ foo.bar = 'bar'
|
|
28
33
|
# or
|
29
34
|
foo.set('bar', 'bar')
|
30
35
|
|
31
|
-
# Set whole record
|
36
|
+
# Set the whole record
|
32
37
|
foo.set(foo: 'foo', bar: 1, )
|
33
|
-
|
34
|
-
```
|
data/deepstream.gemspec
CHANGED
data/lib/deepstream.rb
CHANGED
@@ -75,7 +75,7 @@ class Deepstream::Client
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def _open_socket
|
78
|
-
timeout(2) { @socket = TCPSocket.new(@address, @port) }
|
78
|
+
Timeout.timeout(2) { @socket = TCPSocket.new(@address, @port) }
|
79
79
|
Thread.start do
|
80
80
|
loop { _process_msg(@socket.gets(30.chr).tap { |m| break m.chomp(30.chr).split(31.chr) if m }) }
|
81
81
|
end
|
@@ -108,6 +108,7 @@ class Deepstream::Client
|
|
108
108
|
when %w{E EVT} then _fire_event_callback(msg)
|
109
109
|
when %w{R P} then @records[msg[2]]._patch(msg[3], msg[4], _parse_data(msg[5]))
|
110
110
|
when %w{R U} then @records[msg[2]]._update(msg[3], _parse_data(msg[4]))
|
111
|
+
when %w{R A} then @records.delete(msg[3]) if msg[2] == 'D'
|
111
112
|
else @unread_msg = msg
|
112
113
|
end
|
113
114
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deepstream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Szczudlak
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Basic ruby client for the deepstream.io server
|
14
14
|
email:
|