Class List Method List File List

# Class: Vertx::MessageProducer

Inherits:
  Object
  - Object
  - Vertx::MessageProducer
  show all
Includes:
  WriteStream
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb

## Instance Method Summary (collapse)

- - (Object) address
- - (Object) close
- - (Object) delivery_options(options = nil)
- - (Object) drain_handler
- - (Object) end(t = nil)
- - (Object) exception_handler
- - (MessageProducer) initialize(j_del) constructor
  A new instance of MessageProducer.
- - (Object) j_del
- - (Object) send(message = nil)
- - (Object) set_write_queue_max_size(maxSize = nil)
- - (Object) write(data = nil)
- - (Boolean) write_queue_full?

## Constructor Details

### - (`MessageProducer`) initialize(j_del)

Returns a new instance of MessageProducer

    12
    13
    14
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb', line 12

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) address

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) close

Raises:

- (`ArgumentError`)

    105
    106
    107
    108
    109
    110
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb', line 105

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

### - (`Object`) delivery_options(options = nil)

Raises:

- (`ArgumentError`)

    89
    90
    91
    92
    93
    94
    95
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb', line 89

    def delivery_options(options=nil)
      if options.class == Hash && !block_given?
        @j_del.java_method(:deliveryOptions, [Java::IoVertxCoreEventbus::DeliveryOptions.java_class]).call(Java::IoVertxCoreEventbus::DeliveryOptions.new(::Vertx::Util::Utils.to_json_object(options)))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling delivery_options(options)"
    end

### - (`Object`) drain_handler

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) end(t = nil)

Raises:

- (`ArgumentError`)

    23
    24
    25
    26
    27
    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb', line 23

    def end(t=nil)
      if !block_given? && t == nil
        return @j_del.java_method(:end, []).call()
      elsif (t.class == String  || t.class == Hash || t.class == Array || t.class == NilClass || t.class == TrueClass || t.class == FalseClass || t.class == Fixnum || t.class == Float) && !block_given?
        return @j_del.java_method(:end, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(t))
      end
      raise ArgumentError, "Invalid arguments when calling end(t)"
    end

### - (`Object`) exception_handler

Raises:

- (`ArgumentError`)

    52
    53
    54
    55
    56
    57
    58
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb', line 52

    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`) j_del

    17
    18
    19
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb', line 17

    def j_del
      @j_del
    end

### - (`Object`) send(message = nil)

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    48
    49
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb', line 42

    def send(message=nil)
      if (message.class == String  || message.class == Hash || message.class == Array || message.class == NilClass || message.class == TrueClass || message.class == FalseClass || message.class == Fixnum || message.class == Float) && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:send, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(message)),::Vertx::MessageProducer)
      elsif (message.class == String  || message.class == Hash || message.class == Array || message.class == NilClass || message.class == TrueClass || message.class == FalseClass || message.class == Fixnum || message.class == Float) && block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:send, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_object(message),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::Message) : nil) })),::Vertx::MessageProducer)
      end
      raise ArgumentError, "Invalid arguments when calling send(message)"
    end

### - (`Object`) set_write_queue_max_size(maxSize = nil)

Raises:

- (`ArgumentError`)

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

    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

### - (`Object`) write(data = nil)

Raises:

- (`ArgumentError`)

    61
    62
    63
    64
    65
    66
    67
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb', line 61

    def write(data=nil)
      if (data.class == String  || data.class == Hash || data.class == Array || data.class == NilClass || data.class == TrueClass || data.class == FalseClass || data.class == Fixnum || data.class == Float) && !block_given?
        @j_del.java_method(:write, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(data))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling write(data)"
    end

### - (`Boolean`) write_queue_full?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    33
    34
    35
    36
    37
    38
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/message_producer.rb', line 33

    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