Class: Floom::Request
- Inherits:
-
Object
- Object
- Floom::Request
- Defined in:
- lib/floom/models/request.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(connection, type, *args) ⇒ Request
constructor
A new instance of Request.
- #parse(options = {}) ⇒ Object
Constructor Details
#initialize(connection, type, *args) ⇒ Request
Returns a new instance of Request.
6 7 8 9 10 |
# File 'lib/floom/models/request.rb', line 6 def initialize(connection, type, *args) @connection = connection @type = type @command = FlumeMasterCommandThrift.new(command: type.to_s, arguments: args) end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
4 5 6 |
# File 'lib/floom/models/request.rb', line 4 def connection @connection end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
4 5 6 |
# File 'lib/floom/models/request.rb', line 4 def payload @payload end |
Instance Method Details
#fetch ⇒ Object
12 13 14 15 |
# File 'lib/floom/models/request.rb', line 12 def fetch @response = connection.submit @command self end |
#parse(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/floom/models/request.rb', line 17 def parse( = {}) state = connection.getCmdStatus(@response).state while state == "EXECING" state = connection.getCmdStatus(@response).state end connection.getCmdStatus(@response) end |