Class: Toq::Request
Overview
Represents an RPC request.
It’s here only for formalization purposes, it’s not actually sent over the wire.
What is sent is a hash generated by Message#prepare_for_tx. which is in the form of:
{
# RPC message in the form of 'handler.method'.
'message' => msg,
# Optional array of arguments for the remote method.
'args' => args,
# Optional authentication token.
'token' => token
}
Any client that has SSL support and can serialize a Hash just like the one above can communicate with the RPC server.
Instance Attribute Summary collapse
-
#args ⇒ Array
Optional arguments for the remote method.
-
#callback ⇒ Proc
Callback to be invoked on the response.
-
#message ⇒ String
RPC message in the form of ‘handler.method’.
-
#token ⇒ String
Optional authentication token.
Method Summary
Methods inherited from Message
#initialize, #merge!, #prepare_for_tx
Constructor Details
This class inherits a constructor from Toq::Message
Instance Attribute Details
#args ⇒ Array
Returns Optional arguments for the remote method.
41 42 43 |
# File 'lib/toq/request.rb', line 41 def args @args end |
#callback ⇒ Proc
Returns Callback to be invoked on the response.
49 50 51 |
# File 'lib/toq/request.rb', line 49 def callback @callback end |
#message ⇒ String
Returns RPC message in the form of ‘handler.method’.
37 38 39 |
# File 'lib/toq/request.rb', line 37 def @message end |
#token ⇒ String
Returns Optional authentication token.
45 46 47 |
# File 'lib/toq/request.rb', line 45 def token @token end |