Class: EM::RemoteCall::Client
- Inherits:
-
Object
- Object
- EM::RemoteCall::Client
- Defined in:
- lib/em_remote_call/client.rb
Instance Attribute Summary collapse
-
#instance_finder ⇒ Object
readonly
Returns the value of attribute instance_finder.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#remote_class_name ⇒ Object
readonly
Returns the value of attribute remote_class_name.
Instance Method Summary collapse
- #call(call) ⇒ Object
-
#initialize(opts) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(opts) ⇒ Client
Returns a new instance of Client.
73 74 75 76 77 78 79 |
# File 'lib/em_remote_call/client.rb', line 73 def initialize(opts) @name = opts[:name] ||= :default @remote_class_name = opts[:remote_class_name] @socket = opts[:socket] @port = opts[:port] @instance_finder = opts[:instance_finder] ||= :id end |
Instance Attribute Details
#instance_finder ⇒ Object (readonly)
Returns the value of attribute instance_finder.
70 71 72 |
# File 'lib/em_remote_call/client.rb', line 70 def instance_finder @instance_finder end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
70 71 72 |
# File 'lib/em_remote_call/client.rb', line 70 def name @name end |
#remote_class_name ⇒ Object (readonly)
Returns the value of attribute remote_class_name.
70 71 72 |
# File 'lib/em_remote_call/client.rb', line 70 def remote_class_name @remote_class_name end |
Instance Method Details
#call(call) ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/em_remote_call/client.rb', line 81 def call(call) unless @connection && @connection.connected? @connection = EM::RemoteCall::ClientConnection.connect_to *[@socket, @port].compact end @connection.send_data call end |