alphapoint 0.1.3.1 → 0.1.3.2
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 +5 -5
- data/lib/alphapoint/version.rb +1 -1
- data/lib/alphapoint/web_socket.rb +8 -5
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: a38be284bc09c871078c95ff3c0d365b0d5c65a8
|
|
4
|
+
data.tar.gz: a36408157d6c77729588c36239d215b42bf79c89
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 827899f78296b1f03d2e3ebf5fddc7d1f08e9dc06d4dafc733018b7414d12b96f2d27f953ba98c263cf9ee83df8018cbd9c2f566197c76742b5a1eb7ced541ca
|
|
7
|
+
data.tar.gz: 75a8d527b26ed4b6bda974854e5215f234bae7075e1718830a8e614bc6a4fbabcc1e285ce8dbfc1c0986e5bbe35f0084c0be0321d77ac5a187e68797998e31f9
|
data/lib/alphapoint/version.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Alphapoint
|
|
|
6
6
|
|
|
7
7
|
attr_accessor :address
|
|
8
8
|
|
|
9
|
-
def
|
|
9
|
+
def connect(address = nil, &block)
|
|
10
10
|
if Alphapoint.configuration.nil? ||
|
|
11
11
|
Alphapoint.configuration.address.nil? ||
|
|
12
12
|
Alphapoint.configuration.address.empty?
|
|
@@ -31,12 +31,13 @@ module Alphapoint
|
|
|
31
31
|
|
|
32
32
|
alpha_self = self
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
@thread = Thread.new do
|
|
35
35
|
EM.run do
|
|
36
36
|
@ws = Faye::WebSocket::Client.new(@address)
|
|
37
37
|
|
|
38
38
|
@ws.on :open do |event|
|
|
39
39
|
p [:open, "Websocket connected to #{@address}"]
|
|
40
|
+
block.call(self)
|
|
40
41
|
end
|
|
41
42
|
|
|
42
43
|
@ws.on :message do |event|
|
|
@@ -51,15 +52,17 @@ module Alphapoint
|
|
|
51
52
|
p [:close, event.code, event.reason]
|
|
52
53
|
end
|
|
53
54
|
end
|
|
54
|
-
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
p @thread.status
|
|
55
58
|
|
|
56
59
|
trap(:INT) { EM.stop }
|
|
57
60
|
trap(:TERM){ EM.stop }
|
|
58
61
|
|
|
59
62
|
while not EM.reactor_running?; end
|
|
60
63
|
while not EM.defers_finished?; end
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
|
|
65
|
+
self
|
|
63
66
|
end
|
|
64
67
|
|
|
65
68
|
def build_request(function_name, payload,type = 0, &block)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alphapoint
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.3.
|
|
4
|
+
version: 0.1.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fabiano Martins
|
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
193
193
|
version: '0'
|
|
194
194
|
requirements: []
|
|
195
195
|
rubyforge_project:
|
|
196
|
-
rubygems_version: 2.
|
|
196
|
+
rubygems_version: 2.6.11
|
|
197
197
|
signing_key:
|
|
198
198
|
specification_version: 4
|
|
199
199
|
summary: Alphapoint websocket DSL
|