Class List Method List File List

# Class: Vertx::MessageConsumer

Inherits:
  Object
  - Object
  - Vertx::MessageConsumer
  show all
Includes:
  ReadStream
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb

## Instance Method Summary (collapse)

- - (Object) address
- - (Object) body_stream
- - (Object) completion_handler
- - (Object) end_handler
- - (Object) exception_handler
- - (Object) get_max_buffered_messages
- - (Object) handler
- - (MessageConsumer) initialize(j_del) constructor
  A new instance of MessageConsumer.
- - (Object) j_del
- - (Object) pause
- - (Boolean) registered?
- - (Object) resume
- - (Object) set_max_buffered_messages(maxBufferedMessages = nil)
- - (Object) unregister

## Constructor Details

### - (`MessageConsumer`) initialize(j_del)

Returns a new instance of MessageConsumer

    19
    20
    21
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 19

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) address

Raises:

- (`ArgumentError`)

    85
    86
    87
    88
    89
    90
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 85

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

### - (`Object`) body_stream

Raises:

- (`ArgumentError`)

    71
    72
    73
    74
    75
    76
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 71

    def body_stream
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:bodyStream, []).call(),::Vertx::ReadStreamImpl)
      end
      raise ArgumentError, "Invalid arguments when calling body_stream()"
    end

### - (`Object`) completion_handler

Raises:

- (`ArgumentError`)

    112
    113
    114
    115
    116
    117
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 112

    def completion_handler
      if block_given?
        return @j_del.java_method(:completionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling completion_handler()"
    end

### - (`Object`) end_handler

Raises:

- (`ArgumentError`)

    63
    64
    65
    66
    67
    68
    69
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 63

    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

### - (`Object`) exception_handler

Raises:

- (`ArgumentError`)

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

    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

### - (`Object`) get_max_buffered_messages

Raises:

- (`ArgumentError`)

    103
    104
    105
    106
    107
    108
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 103

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

### - (`Object`) handler

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) j_del

    24
    25
    26
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 24

    def j_del
      @j_del
    end

### - (`Object`) pause

Raises:

- (`ArgumentError`)

    46
    47
    48
    49
    50
    51
    52
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 46

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

### - (`Boolean`) registered?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    78
    79
    80
    81
    82
    83
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 78

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

### - (`Object`) resume

Raises:

- (`ArgumentError`)

    54
    55
    56
    57
    58
    59
    60
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 54

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

### - (`Object`) set_max_buffered_messages(maxBufferedMessages = nil)

Raises:

- (`ArgumentError`)

    96
    97
    98
    99
    100
    101
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 96

    def set_max_buffered_messages(maxBufferedMessages=nil)
      if maxBufferedMessages.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setMaxBufferedMessages, [Java::int.java_class]).call(maxBufferedMessages),::Vertx::MessageConsumer)
      end
      raise ArgumentError, "Invalid arguments when calling set_max_buffered_messages(maxBufferedMessages)"
    end

### - (`Object`) unregister

Raises:

- (`ArgumentError`)

    121
    122
    123
    124
    125
    126
    127
    128
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_consumer.rb', line 121

    def unregister
      if !block_given?
        return @j_del.java_method(:unregister, []).call()
      elsif block_given?
        return @j_del.java_method(:unregister, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling unregister()"
    end