basicjrpc 0.1.53 → 0.1.54

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: 879d75c26757f027a1cc89dddabe3a1d27b09f5c
4
- data.tar.gz: f1d1044f117ee6f2e71a7fd101e5cfd2cfa64dc0
3
+ metadata.gz: 1a50bdaad064f8914e049227096b99a7b1f41774
4
+ data.tar.gz: 8d0e61b1444119727ddd447d26d63a1007d0cc4b
5
5
  SHA512:
6
- metadata.gz: b744483499b254905ec9af3a5cdbfae7e6e08c4ff6437b4b5d59adab7753a6569d7d3d87e7a698dd96fb18151e15bff52e810f377b0b08a34fee2541683079d3
7
- data.tar.gz: 1b5eb08b438ce610d3e14a5146302646cc440221748d09a3a21c9284a13a897c9a93decbf2cf6da45a55c5a0a8dfb06752543bc5cc88032689913399ee916f5a
6
+ metadata.gz: 968143d899be24449685637c604cff574b2e4f0e2f4f301dda63fdb885a1e3b64af9f4646e1fb4917a8b0e6b15dc6b0140bde40ad82ad23c5a883128c95637cc
7
+ data.tar.gz: f0bb45c4781d8bd8df359ec52d6d7b88c9d4ea8e6403f8e03ff8aee4b5aa5a5e600eec362471b73e9246229f51cd8820d1f740e2922121f8d2c96688942878ba
@@ -10,13 +10,13 @@ module BasicJRPC
10
10
 
11
11
  # Responding Client
12
12
  class Client
13
- def initialize(queue, timeout = 5)
13
+ def initialize(queue, timeout = 5, host="redis")
14
14
  @queue = queue
15
15
  @payload = {}
16
16
  @timeout = timeout
17
17
  @instance_id = SecureRandom.uuid
18
18
  #@nsq_producer = Nsq::Producer.new(nsqd: 'dockerlb:4150', topic: @queue)
19
- @redis = Redis.new(host: "redis")
19
+ @redis = Redis.new(host: host)
20
20
  end
21
21
 
22
22
  def method_missing(m, *args, &block)
@@ -30,7 +30,7 @@ module BasicJRPC
30
30
 
31
31
  my_message = false
32
32
 
33
- puts "Writing Message #{payload['message_id']} #{payload['method_name']}"
33
+ #puts "Writing Message #{payload['message_id']} #{payload['method_name']}"
34
34
  #@nsq_producer.write(Oj.dump(payload))
35
35
  @redis.rpush(@queue, Oj.dump(payload, mode: :compat))
36
36
 
@@ -1,11 +1,11 @@
1
1
  module BasicJRPC
2
2
  class Server
3
3
 
4
- def initialize queue, injected_class
4
+ def initialize queue, injected_class, host="redis"
5
5
  @injected_class = injected_class
6
6
  @queue = queue
7
7
  #@nsq_consumer = Nsq::Consumer.new(nsqlookupd: 'dockerlb:4161', topic: @queue, channel: 'server')
8
- @redis = Redis.new(host: "redis")
8
+ @redis = Redis.new(host: host)
9
9
  end
10
10
 
11
11
  def listen
@@ -18,7 +18,7 @@ module BasicJRPC
18
18
  #message = @nsq_consumer.pop
19
19
 
20
20
  payload = Oj.load(message, :symbol_keys => true)
21
- puts "Processing message #{payload.message_id} #{payload.method_name} #{payload.method_arguments} #{payload.callers}"
21
+ #puts "Processing message #{payload.message_id} #{payload.method_name} #{payload.method_arguments} #{payload.callers}"
22
22
 
23
23
  # Should always return a data object
24
24
  response = @injected_class.send(payload.method_name, *payload.method_arguments)
@@ -1,3 +1,3 @@
1
1
  module BasicJRPC
2
- VERSION = "0.1.53"
2
+ VERSION = "0.1.54"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basicjrpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.53
4
+ version: 0.1.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Simpson