Class: BasicJRPC::FAFClient
Overview
Fire And Forget Client
Instance Method Summary collapse
Methods inherited from Client
#initialize, #method_missing, #terminate
Constructor Details
This class inherits a constructor from BasicJRPC::Client
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BasicJRPC::Client
Instance Method Details
#get_response(message_id) ⇒ Object
68 69 70 71 72 |
# File 'lib/basicjrpc/client.rb', line 68 def get_response Timeout::timeout(5) { r = Oj.load(@redis.blpop()[1]) } end |
#send_request(payload, message_id = SecureRandom.uuid) ⇒ Object
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/basicjrpc/client.rb', line 57 def send_request payload, =SecureRandom.uuid payload[:message_id] = SecureRandom.uuid payload[:response] = true payload[:caller] = caller.first(10) #@nsq_producer.write(Oj.dump(payload)) @redis.rpush(@queue, Oj.dump(payload)) rescue Exception => e #terminate raise e end |