Class: ActiveRpc::ClientFactory
- Inherits:
-
Object
- Object
- ActiveRpc::ClientFactory
- Includes:
- Singleton
- Defined in:
- lib/active_rpc/client_factory.rb
Instance Method Summary collapse
- #client_for(subsystem, service_name) ⇒ Object
-
#initialize ⇒ ClientFactory
constructor
A new instance of ClientFactory.
Constructor Details
#initialize ⇒ ClientFactory
Returns a new instance of ClientFactory.
23 24 25 |
# File 'lib/active_rpc/client_factory.rb', line 23 def initialize @clients = {} end |
Instance Method Details
#client_for(subsystem, service_name) ⇒ Object
27 28 29 30 |
# File 'lib/active_rpc/client_factory.rb', line 27 def client_for(subsystem, service_name) key = "#{subsystem}_#{service_name}" @clients[key] ||= create_client(subsystem, service_name) end |