basicjrpc 0.1.54 → 0.1.55
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/basicjrpc/client.rb +0 -5
- data/lib/basicjrpc/server.rb +1 -8
- data/lib/basicjrpc/version.rb +1 -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: d4c9b60ca4e80e1eed0a83036234f79965268706
|
4
|
+
data.tar.gz: 20f046ee7f51f07ea7b7cfc9b70addf7115aa45c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfdb34b9e7e689f42d1629248c6cbb03814b239912673cfebb423897bd89c29b313837f823f42020030b842218cc4d708e5e0a72bc591502bed229ba6f275335
|
7
|
+
data.tar.gz: 823a33e80e11249266370883a6770f470c1be641d659705f31ccd2f03794937139c72d4febab43b1c1f59772cbb9fdbb8cdcf9006a9d7251ba09b0c06a9b199a
|
data/lib/basicjrpc/client.rb
CHANGED
@@ -30,12 +30,9 @@ module BasicJRPC
|
|
30
30
|
|
31
31
|
my_message = false
|
32
32
|
|
33
|
-
#puts "Writing Message #{payload['message_id']} #{payload['method_name']}"
|
34
|
-
#@nsq_producer.write(Oj.dump(payload))
|
35
33
|
@redis.rpush(@queue, Oj.dump(payload, mode: :compat))
|
36
34
|
|
37
35
|
Timeout::timeout(5) {
|
38
|
-
### OR USE POP AND LLEN
|
39
36
|
Oj.load(@redis.blpop(payload['message_id'])[1], :symbol_keys => true)
|
40
37
|
}
|
41
38
|
rescue Exception => e
|
@@ -55,12 +52,10 @@ module BasicJRPC
|
|
55
52
|
payload['message_id'] = SecureRandom.uuid
|
56
53
|
payload['response'] = true
|
57
54
|
payload['caller'] = caller.first(10)
|
58
|
-
#@nsq_producer.write(Oj.dump(payload))
|
59
55
|
@redis.rpush(@queue, Oj.dump(payload, mode: :compat))
|
60
56
|
rescue Exception => e
|
61
57
|
#terminate
|
62
58
|
raise e
|
63
59
|
end
|
64
60
|
end
|
65
|
-
|
66
61
|
end
|
data/lib/basicjrpc/server.rb
CHANGED
@@ -15,20 +15,13 @@ module BasicJRPC
|
|
15
15
|
next if redis_response.nil?
|
16
16
|
message = redis_response[1]
|
17
17
|
|
18
|
-
#message = @nsq_consumer.pop
|
19
|
-
|
20
18
|
payload = Oj.load(message, :symbol_keys => true)
|
21
|
-
|
22
|
-
|
23
|
-
# Should always return a data object
|
19
|
+
|
24
20
|
response = @injected_class.send(payload.method_name, *payload.method_arguments)
|
25
21
|
|
26
22
|
@redis.rpush(payload.message_id, Oj.dump(response, mode: :compat))
|
27
|
-
#message.finish
|
28
23
|
end
|
29
24
|
rescue Exception => e
|
30
|
-
#message.finish
|
31
|
-
#terminate
|
32
25
|
raise e
|
33
26
|
end
|
34
27
|
|
data/lib/basicjrpc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: basicjrpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.55
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Simpson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|