Class List Method List File List

# Module: Vertx::ReadStream

Includes:
  StreamBase
Included in:
  AsyncFile, DatagramSocket, HttpClientRequest, HttpClientResponse, HttpServerFileUpload, HttpServerRequest, MessageConsumer, NetSocket, ReadStreamImpl, TimeoutStream, WebSocketBase, VertxKafkaClient::KafkaConsumer, VertxSql::SQLRowStream, VertxUnit::TestSuiteReport, VertxWeb::SockJSSocket
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/read_stream.rb

## Instance Method Summary (collapse)

- - (self) end_handler { ... }
  Set an end handler.
- - (self) exception_handler { ... }
  Set an exception handler on the read stream.
- - (self) handler { ... }
  Set a data handler.
- - (self) pause
  Pause the ReadSupport.
- - (self) resume
  Resume reading.

## Instance Method Details

### - (`self`) end_handler { ... }

Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    48
    49
    50
    51
    52
    53
    54
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/read_stream.rb', line 48

    def end_handler
      if block_given?
        @j_del.java_method(:endHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
        return self
      end
      raise ArgumentError, "Invalid arguments when calling end_handler()"
    end

### - (`self`) exception_handler { ... }

Set an exception handler on the read stream.

Yields:

- the exception handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    10
    11
    12
    13
    14
    15
    16
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/read_stream.rb', line 10

    def exception_handler
      if block_given?
        @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling exception_handler()"
    end

### - (`self`) handler { ... }

Set a data handler. As data is read, the handler will be called with the data.

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    20
    21
    22
    23
    24
    25
    26
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/read_stream.rb', line 20

    def handler
      if block_given?
        @j_del.java_method(:handler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(@j_arg_T.wrap(event)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling handler()"
    end

### - (`self`) pause

Pause the `ReadSupport`. While it's paused, no data will be sent to the `dataHandler`

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    29
    30
    31
    32
    33
    34
    35
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/read_stream.rb', line 29

    def pause
      if !block_given?
        @j_del.java_method(:pause, []).call()
        return self
      end
      raise ArgumentError, "Invalid arguments when calling pause()"
    end

### - (`self`) resume

Resume reading. If the `ReadSupport` has been paused, reading will recommence on it.

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    38
    39
    40
    41
    42
    43
    44
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/read_stream.rb', line 38

    def resume
      if !block_given?
        @j_del.java_method(:resume, []).call()
        return self
      end
      raise ArgumentError, "Invalid arguments when calling resume()"
    end