Class List Method List File List

# Class: Vertx::TimeoutStream

Inherits:
  Object
  - Object
  - Vertx::TimeoutStream
  show all
Includes:
  ReadStream
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/timeout_stream.rb

## Overview

A timeout stream is triggered by a timer, the Proc will be call when the timer is fired, it can be once or several times depending on the nature of the timer related to this stream. The will be called after the timer handler has been called.

Pausing the timer inhibits the timer shots until the stream is resumed. Setting a null handler callback cancels the timer.

## Instance Method Summary (collapse)

- - (void) cancel
  Cancels the timeout.
- - (self) end_handler { ... }
- - (self) exception_handler { ... }
- - (self) handler { ... }
- - (self) pause
- - (self) resume

## Instance Method Details

### - (`void`) cancel

This method returns an undefined value.

Cancels the timeout. Note this has the same effect as calling #handler with a null argument.

Raises:

- (`ArgumentError`)

    69
    70
    71
    72
    73
    74
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/timeout_stream.rb', line 69

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

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

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    59
    60
    61
    62
    63
    64
    65
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/timeout_stream.rb', line 59

    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 { ... }

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    25
    26
    27
    28
    29
    30
    31
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/timeout_stream.rb', line 25

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

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

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    34
    35
    36
    37
    38
    39
    40
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/timeout_stream.rb', line 34

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

### - (`self`) pause

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    48
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/timeout_stream.rb', line 42

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

### - (`self`) resume

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    50
    51
    52
    53
    54
    55
    56
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/timeout_stream.rb', line 50

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