Class: Cql::Protocol::CqlProtocolHandler::RequestPromise
- Inherits:
-
Cql::Promise
- Object
- Cql::Promise
- Cql::Protocol::CqlProtocolHandler::RequestPromise
- Defined in:
- lib/cql/protocol/cql_protocol_handler.rb
Instance Attribute Summary collapse
-
#frame ⇒ Object
readonly
Returns the value of attribute frame.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Attributes inherited from Cql::Promise
Instance Method Summary collapse
- #encode_frame! ⇒ Object
-
#initialize(request) ⇒ RequestPromise
constructor
A new instance of RequestPromise.
- #time_out! ⇒ Object
- #timed_out? ⇒ Boolean
Methods inherited from Cql::Promise
#fail, #fulfill, #observe, #try
Constructor Details
#initialize(request) ⇒ RequestPromise
Returns a new instance of RequestPromise.
155 156 157 158 159 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 155 def initialize(request) @request = request @timed_out = false super() end |
Instance Attribute Details
#frame ⇒ Object (readonly)
Returns the value of attribute frame.
153 154 155 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 153 def frame @frame end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
153 154 155 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 153 def request @request end |
Instance Method Details
#encode_frame! ⇒ Object
172 173 174 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 172 def encode_frame! @frame = @request.encode_frame(0) end |
#time_out! ⇒ Object
165 166 167 168 169 170 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 165 def time_out! unless future.completed? @timed_out = true fail(TimeoutError.new) end end |
#timed_out? ⇒ Boolean
161 162 163 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 161 def timed_out? @timed_out end |