Class: Vertx::HttpServerResponse
- Inherits:
-
Object
- Object
- Vertx::HttpServerResponse
- Includes:
- WriteStream
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb
Overview
An instance of this is created and associated to every instance of HttpServerRequest that.
It allows the developer to control the HTTP response that is sent back to the client for a particular HTTP request.
It contains methods that allow HTTP headers and trailers to be set, and for a body to be written out to the response.
It also allows files to be streamed by the kernel directly from disk to the outgoing HTTP connection, bypassing user space altogether (where supported by the underlying operating system). This is a very efficient way of serving files from the server since buffers do not have to be read one by one from the file and written to the outgoing socket.
It implements WriteStream so it can be used with Pump to pump data with flow control.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (self) body_end_handler { ... }
Provides a handler that will be called after the last part of the body is written to the wire.
-
- (Fixnum) bytes_written
The total number of bytes written for the body of the response.
-
- (true, false) chunked?
Is the response chunked?.
-
- (void) close
Close the underlying TCP connection corresponding to the request.
-
- (self) close_handler { ... }
Set a close handler for the response, this is called when the underlying connection is closed and the response was still using the connection.
-
- (true, false) closed?
Has the underlying TCP connection corresponding to the request already been closed?.
- - (self) drain_handler { ... }
-
- (void) end(param_1 = nil, param_2 = nil)
Same as #end but with an handler called when the operation completes.
-
- (self) end_handler { ... }
Set an end handler for the response.
-
- (true, false) ended?
Has the response already ended?.
- - (self) exception_handler { ... }
-
- (Fixnum) get_status_code
The HTTP status code of the response.
-
- (String) get_status_message
The HTTP status message of the response.
-
- (true, false) head_written?
Have the headers for the response already been written?.
-
- (::Vertx::MultiMap) headers
The HTTP headers.
-
- (self) headers_end_handler { ... }
Provide a handler that will be called just before the headers are written to the wire.
-
- (self) push(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil)
Push a response to the client.
-
- (self) put_header(name = nil, value = nil)
Put an HTTP header.
-
- (self) put_trailer(name = nil, value = nil)
Put an HTTP trailer.
-
- (void) reset(code = nil)
Reset this HTTP/2 stream with the error code.
-
- (self) send_file(filename = nil, offset = nil, length = nil) { ... }
Like #send_file but providing a handler which will be notified once the file has been completely written to the wire.
-
- (self) set_chunked(chunked = nil)
If chunked is true, this response will use HTTP chunked encoding, and each call to write to the body will correspond to a new HTTP chunk sent on the wire.
-
- (self) set_status_code(statusCode = nil)
Set the status code.
-
- (self) set_status_message(statusMessage = nil)
Set the status message.
-
- (self) set_stream_priority(streamPriority = nil)
Sets the priority of the associated stream This is not implemented for HTTP/1.x.
- - (self) set_write_queue_max_size(maxSize = nil)
-
- (Fixnum) stream_id
The id of the stream of this response, for HTTP/1.x.
-
- (::Vertx::MultiMap) trailers
The HTTP trailers.
-
- (void) write(param_1 = nil, param_2 = nil)
Same as #write but with an handler called when the operation completes.
-
- (self) write_continue
Used to write an interim 100 Continue response to signify that the client should send the rest of the request.
-
- (self) write_custom_frame(param_1 = nil, param_2 = nil, param_3 = nil)
Write an HTTP/2 frame to the response, allowing to extend the HTTP/2 protocol.
-
- (true, false) write_queue_full?
This will return true if there are more bytes in the write queue than the value set using #set_write_queue_max_size.
Class Method Details
+ (Boolean) accept?(obj)
40 41 42 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 40 def @@j_api_type.accept?(obj) obj.class == HttpServerResponse end |
+ (Object) j_api_type
49 50 51 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 49 def self.j_api_type @@j_api_type end |
+ (Object) j_class
52 53 54 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 52 def self.j_class Java::IoVertxCoreHttp::HttpServerResponse.java_class end |
+ (Object) unwrap(obj)
46 47 48 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 46 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
43 44 45 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 43 def @@j_api_type.wrap(obj) HttpServerResponse.new(obj) end |
Instance Method Details
- (self) body_end_handler { ... }
345 346 347 348 349 350 351 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 345 def body_end_handler if true @j_del.java_method(:bodyEndHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? }) return self end raise ArgumentError, "Invalid arguments when calling body_end_handler()" end |
- (Fixnum) bytes_written
353 354 355 356 357 358 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 353 def bytes_written if !block_given? return @j_del.java_method(:bytesWritten, []).call() end raise ArgumentError, "Invalid arguments when calling bytes_written()" end |
- (true, false) chunked?
194 195 196 197 198 199 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 194 def chunked? if !block_given? return @j_del.java_method(:isChunked, []).call() end raise ArgumentError, "Invalid arguments when calling chunked?()" end |
- (void) close
This method returns an undefined value.
Close the underlying TCP connection corresponding to the request.
301 302 303 304 305 306 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 301 def close if !block_given? return @j_del.java_method(:close, []).call() end raise ArgumentError, "Invalid arguments when calling close()" end |
- (self) close_handler { ... }
For HTTP/1.x it is called when the connection is closed before end() is called, therefore it is not
guaranteed to be called.
For HTTP/2 it is called when the related stream is closed, and therefore it will be always be called.
251 252 253 254 255 256 257 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 251 def close_handler if true @j_del.java_method(:closeHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? }) return self end raise ArgumentError, "Invalid arguments when calling close_handler()" end |
- (true, false) closed?
315 316 317 318 319 320 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 315 def closed? if !block_given? return @j_del.java_method(:closed, []).call() end raise ArgumentError, "Invalid arguments when calling closed?()" end |
- (self) drain_handler { ... }
131 132 133 134 135 136 137 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 131 def drain_handler if true @j_del.java_method(:drainHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? }) return self end raise ArgumentError, "Invalid arguments when calling drain_handler()" end |
- (void) end(handler) { ... } - (void) end(chunk, handler) { ... } - (void) end(chunk, handler) { ... } - (void) end(chunk, enc, handler) { ... }
This method returns an undefined value.
Same as #end but with anhandler called when the operation completes
91 92 93 94 95 96 97 98 99 100 101 102 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 91 def end(param_1=nil,param_2=nil) if true && param_1 == nil && param_2 == nil return @j_del.java_method(:end, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class == String && true && param_2 == nil return @j_del.java_method(:end, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class.method_defined?(:j_del) && true && param_2 == nil return @j_del.java_method(:end, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class == String && param_2.class == String && true return @j_del.java_method(:end, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1,param_2,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling end(#{param_1},#{param_2})" end |
- (self) end_handler { ... }
262 263 264 265 266 267 268 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 262 def end_handler if true @j_del.java_method(:endHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? }) return self end raise ArgumentError, "Invalid arguments when calling end_handler()" end |
- (true, false) ended?
308 309 310 311 312 313 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 308 def ended? if !block_given? return @j_del.java_method(:ended, []).call() end raise ArgumentError, "Invalid arguments when calling ended?()" end |
- (self) exception_handler { ... }
113 114 115 116 117 118 119 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 113 def exception_handler if true @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) unless !block_given? })) return self end raise ArgumentError, "Invalid arguments when calling exception_handler()" end |
- (Fixnum) get_status_code
200 representing OK.
139 140 141 142 143 144 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 139 def get_status_code if !block_given? return @j_del.java_method(:getStatusCode, []).call() end raise ArgumentError, "Invalid arguments when calling get_status_code()" end |
- (String) get_status_message
157 158 159 160 161 162 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 157 def if !block_given? return @j_del.java_method(:getStatusMessage, []).call() end raise ArgumentError, "Invalid arguments when calling get_status_message()" end |
- (true, false) head_written?
322 323 324 325 326 327 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 322 def head_written? if !block_given? return @j_del.java_method(:headWritten, []).call() end raise ArgumentError, "Invalid arguments when calling head_written?()" end |
- (::Vertx::MultiMap) headers
201 202 203 204 205 206 207 208 209 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 201 def headers if !block_given? if @cached_headers != nil return @cached_headers end return @cached_headers = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:headers, []).call(),::Vertx::MultiMap) end raise ArgumentError, "Invalid arguments when calling headers()" end |
- (self) headers_end_handler { ... }
This provides a hook allowing you to add any more headers or do any more operations before this occurs.
332 333 334 335 336 337 338 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 332 def headers_end_handler if true @j_del.java_method(:headersEndHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? }) return self end raise ArgumentError, "Invalid arguments when calling headers_end_handler()" end |
- (self) push(method, path, handler) { ... } - (self) push(method, host, path, handler) { ... } - (self) push(method, path, headers, handler) { ... } - (self) push(method, host, path, headers, handler) { ... }
handler will be notified with a success when the push can be sent and with
a failure when the client has disabled push or reset the push before it has been sent.
The handler may be queued if the client has reduced the maximum number of streams the server can push
concurrently.
Push can be sent only for peer initiated streams and if the response is not ended.
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 396 def push(param_1=nil,param_2=nil,param_3=nil,param_4=nil) if param_1.class == Symbol && param_2.class == String && true && param_3 == nil && param_4 == nil @j_del.java_method(:push, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1.to_s),param_2,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::HttpServerResponse) : nil) } unless !block_given?)) return self elsif param_1.class == Symbol && param_2.class == String && param_3.class == String && true && param_4 == nil @j_del.java_method(:push, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1.to_s),param_2,param_3,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::HttpServerResponse) : nil) } unless !block_given?)) return self elsif param_1.class == Symbol && param_2.class == String && param_3.class.method_defined?(:j_del) && true && param_4 == nil @j_del.java_method(:push, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::MultiMap.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1.to_s),param_2,param_3.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::HttpServerResponse) : nil) } unless !block_given?)) return self elsif param_1.class == Symbol && param_2.class == String && param_3.class == String && param_4.class.method_defined?(:j_del) && true @j_del.java_method(:push, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::MultiMap.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1.to_s),param_2,param_3,param_4.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::HttpServerResponse) : nil) } unless !block_given?)) return self end raise ArgumentError, "Invalid arguments when calling push(#{param_1},#{param_2},#{param_3},#{param_4})" end |
- (self) put_header(name = nil, value = nil)
214 215 216 217 218 219 220 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 214 def put_header(name=nil,value=nil) if name.class == String && value.class == String && !block_given? @j_del.java_method(:putHeader, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(name,value) return self end raise ArgumentError, "Invalid arguments when calling put_header(#{name},#{value})" end |
- (self) put_trailer(name = nil, value = nil)
235 236 237 238 239 240 241 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 235 def put_trailer(name=nil,value=nil) if name.class == String && value.class == String && !block_given? @j_del.java_method(:putTrailer, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(name,value) return self end raise ArgumentError, "Invalid arguments when calling put_trailer(#{name},#{value})" end |
- (void) reset(code = nil)
This method returns an undefined value.
Reset this HTTP/2 stream with the errorcode.
415 416 417 418 419 420 421 422 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 415 def reset(code=nil) if !block_given? && code == nil return @j_del.java_method(:reset, []).call() elsif code.class == Fixnum && !block_given? return @j_del.java_method(:reset, [Java::long.java_class]).call(code) end raise ArgumentError, "Invalid arguments when calling reset(#{code})" end |
- (self) send_file(filename = nil, offset = nil, length = nil) { ... }
286 287 288 289 290 291 292 293 294 295 296 297 298 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 286 def send_file(filename=nil,offset=nil,length=nil) if filename.class == String && true && offset == nil && length == nil @j_del.java_method(:sendFile, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(filename,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) return self elsif filename.class == String && offset.class == Fixnum && true && length == nil @j_del.java_method(:sendFile, [Java::java.lang.String.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(filename,offset,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) return self elsif filename.class == String && offset.class == Fixnum && length.class == Fixnum && true @j_del.java_method(:sendFile, [Java::java.lang.String.java_class,Java::long.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(filename,offset,length,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) return self end raise ArgumentError, "Invalid arguments when calling send_file(#{filename},#{offset},#{length})" end |
- (self) set_chunked(chunked = nil)
chunked is true, this response will use HTTP chunked encoding, and each call to write to the body
will correspond to a new HTTP chunk sent on the wire.
If chunked encoding is used the HTTP header Transfer-Encoding with a value of Chunked will be
automatically inserted in the response.
If chunked is false, this response will not use HTTP chunked encoding, and therefore the total size
of any data that is written in the respone body must be set in the Content-Length header before any
data is written out.
An HTTP chunked response is typically used when you do not know the total size of the request body up front.
186 187 188 189 190 191 192 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 186 def set_chunked(chunked=nil) if (chunked.class == TrueClass || chunked.class == FalseClass) && !block_given? @j_del.java_method(:setChunked, [Java::boolean.java_class]).call(chunked) return self end raise ArgumentError, "Invalid arguments when calling set_chunked(#{chunked})" end |
- (self) set_status_code(statusCode = nil)
149 150 151 152 153 154 155 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 149 def set_status_code(statusCode=nil) if statusCode.class == Fixnum && !block_given? @j_del.java_method(:setStatusCode, [Java::int.java_class]).call(statusCode) return self end raise ArgumentError, "Invalid arguments when calling set_status_code(#{statusCode})" end |
- (self) set_status_message(statusMessage = nil)
166 167 168 169 170 171 172 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 166 def (statusMessage=nil) if statusMessage.class == String && !block_given? @j_del.java_method(:setStatusMessage, [Java::java.lang.String.java_class]).call(statusMessage) return self end raise ArgumentError, "Invalid arguments when calling set_status_message(#{statusMessage})" end |
- (self) set_stream_priority(streamPriority = nil)
448 449 450 451 452 453 454 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 448 def set_stream_priority(streamPriority=nil) if streamPriority.class == Hash && !block_given? @j_del.java_method(:setStreamPriority, [Java::IoVertxCoreHttp::StreamPriority.java_class]).call(Java::IoVertxCoreHttp::StreamPriority.new(::Vertx::Util::Utils.to_json_object(streamPriority))) return self end raise ArgumentError, "Invalid arguments when calling set_stream_priority(#{streamPriority})" end |
- (self) set_write_queue_max_size(maxSize = nil)
122 123 124 125 126 127 128 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 122 def set_write_queue_max_size(maxSize=nil) if maxSize.class == Fixnum && !block_given? @j_del.java_method(:setWriteQueueMaxSize, [Java::int.java_class]).call(maxSize) return self end raise ArgumentError, "Invalid arguments when calling set_write_queue_max_size(#{maxSize})" end |
- (Fixnum) stream_id
360 361 362 363 364 365 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 360 def stream_id if !block_given? return @j_del.java_method(:streamId, []).call() end raise ArgumentError, "Invalid arguments when calling stream_id()" end |
- (::Vertx::MultiMap) trailers
222 223 224 225 226 227 228 229 230 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 222 def trailers if !block_given? if @cached_trailers != nil return @cached_trailers end return @cached_trailers = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:trailers, []).call(),::Vertx::MultiMap) end raise ArgumentError, "Invalid arguments when calling trailers()" end |
- (void) write(data, handler) { ... } - (void) write(chunk, handler) { ... } - (void) write(chunk, enc, handler) { ... }
This method returns an undefined value.
Same as #write but with anhandler called when the operation completes
67 68 69 70 71 72 73 74 75 76 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 67 def write(param_1=nil,param_2=nil) if param_1.class.method_defined?(:j_del) && true && param_2 == nil return @j_del.java_method(:write, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class == String && true && param_2 == nil return @j_del.java_method(:write, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class == String && param_2.class == String && true return @j_del.java_method(:write, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1,param_2,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling write(#{param_1},#{param_2})" end |
- (self) write_continue
272 273 274 275 276 277 278 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 272 def write_continue if !block_given? @j_del.java_method(:writeContinue, []).call() return self end raise ArgumentError, "Invalid arguments when calling write_continue()" end |
- (self) writeCustomFrame(frame) - (self) writeCustomFrame(type, flags, payload)
The frame is sent immediatly and is not subject to flow control.
433 434 435 436 437 438 439 440 441 442 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 433 def write_custom_frame(param_1=nil,param_2=nil,param_3=nil) if param_1.class.method_defined?(:j_del) && !block_given? && param_2 == nil && param_3 == nil @j_del.java_method(:writeCustomFrame, [Java::IoVertxCoreHttp::HttpFrame.java_class]).call(param_1.j_del) return self elsif param_1.class == Fixnum && param_2.class == Fixnum && param_3.class.method_defined?(:j_del) && !block_given? @j_del.java_method(:writeCustomFrame, [Java::int.java_class,Java::int.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(param_1,param_2,param_3.j_del) return self end raise ArgumentError, "Invalid arguments when calling write_custom_frame(#{param_1},#{param_2},#{param_3})" end |
- (true, false) write_queue_full?
true if there are more bytes in the write queue than the value set using #set_write_queue_max_size
105 106 107 108 109 110 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_response.rb', line 105 def write_queue_full? if !block_given? return @j_del.java_method(:writeQueueFull, []).call() end raise ArgumentError, "Invalid arguments when calling write_queue_full?()" end |