Class: Thrifter::Client::Dispatcher
- Inherits:
-
Object
- Object
- Thrifter::Client::Dispatcher
- Defined in:
- lib/thrifter.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#transport ⇒ Object
readonly
Returns the value of attribute transport.
Instance Method Summary collapse
- #call(rpc) ⇒ Object
-
#initialize(app, transport, client, config) ⇒ Dispatcher
constructor
A new instance of Dispatcher.
Constructor Details
#initialize(app, transport, client, config) ⇒ Dispatcher
Returns a new instance of Dispatcher.
90 91 92 |
# File 'lib/thrifter.rb', line 90 def initialize(app, transport, client, config) @app, @transport, @client, @config = app, transport, client, config end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
88 89 90 |
# File 'lib/thrifter.rb', line 88 def app @app end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
88 89 90 |
# File 'lib/thrifter.rb', line 88 def client @client end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
88 89 90 |
# File 'lib/thrifter.rb', line 88 def config @config end |
#transport ⇒ Object (readonly)
Returns the value of attribute transport.
88 89 90 |
# File 'lib/thrifter.rb', line 88 def transport @transport end |
Instance Method Details
#call(rpc) ⇒ Object
94 95 96 97 98 99 100 101 102 103 |
# File 'lib/thrifter.rb', line 94 def call(rpc) transport.open unless transport.open? client.send(rpc.name, *rpc.args).tap do transport.close unless config.keep_alive end rescue => ex transport.close raise ex end |