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, frame_encoder) ⇒ 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, frame_encoder) ⇒ RequestPromise
Returns a new instance of RequestPromise.
158 159 160 161 162 163 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 158 def initialize(request, frame_encoder) @request = request @frame_encoder = frame_encoder @timed_out = false super() end |
Instance Attribute Details
#frame ⇒ Object (readonly)
Returns the value of attribute frame.
156 157 158 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 156 def frame @frame end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
156 157 158 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 156 def request @request end |
Instance Method Details
#encode_frame! ⇒ Object
176 177 178 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 176 def encode_frame! @frame = @frame_encoder.encode_frame(@request) end |
#time_out! ⇒ Object
169 170 171 172 173 174 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 169 def time_out! unless future.completed? @timed_out = true fail(TimeoutError.new) end end |
#timed_out? ⇒ Boolean
165 166 167 |
# File 'lib/cql/protocol/cql_protocol_handler.rb', line 165 def timed_out? @timed_out end |