Class: JRPC::TcpClient
- Inherits:
-
BaseClient
- Object
- BaseClient
- JRPC::TcpClient
- Defined in:
- lib/jrpc/tcp_client.rb
Constant Summary
Constants inherited from BaseClient
Instance Attribute Summary collapse
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
Attributes inherited from BaseClient
Instance Method Summary collapse
-
#initialize(uri, options = {}) ⇒ TcpClient
constructor
A new instance of TcpClient.
Methods inherited from BaseClient
#invoke_notification, #invoke_request, #method_missing
Constructor Details
#initialize(uri, options = {}) ⇒ TcpClient
Returns a new instance of TcpClient.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/jrpc/tcp_client.rb', line 8 def initialize(uri, = {}) super @namespace = .delete(:namespace).to_s t = .fetch(:timeout, 5) @client = Net::TCPClient.new server: @uri, connect_retry_count: t, connect_timeout: t, read_timeout: t, # write_timeout: t, buffered: false # recommended for RPC end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class JRPC::BaseClient
Instance Attribute Details
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
5 6 7 |
# File 'lib/jrpc/tcp_client.rb', line 5 def namespace @namespace end |