vertx-lang-scala-docs_2.12 3.5.3.CR1 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package core
  Definition Classes
    scala
-  package eventbus
  Definition Classes
    core
- DeliveryOptions
- EventBus
- EventBusOptions
- Message
- MessageConsumer
- MessageProducer
- SendContext

c

io.vertx.scala.core.eventbus

# MessageConsumer 

###
Companion object MessageConsumer

#### class MessageConsumer[T] extends ReadStream[Message[T]]

An event bus consumer object representing a stream of message to an io.vertx.scala.core.eventbus.EventBus address that can be read from.

The io.vertx.scala.core.eventbus.EventBus#consumer or io.vertx.scala.core.eventbus.EventBus#localConsumer creates a new consumer, the returned consumer is not yet registered against the event bus. Registration is effective after the io.vertx.scala.core.eventbus.MessageConsumer#handler method is invoked.

The consumer is unregistered from the event bus using the io.vertx.scala.core.eventbus.MessageConsumer#unregister method or by calling the io.vertx.scala.core.eventbus.MessageConsumer#handler with a null value..

Linear Supertypes
ReadStream[Message[T]], StreamBase, AnyRef, Any
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. MessageConsumer
2. ReadStream
3. StreamBase
4. AnyRef
5. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new MessageConsumer(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T])

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  def address(): String

   returns

     The address the handler was registered with.

5.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
6.  def asJava: AnyRef
   Definition Classes
     MessageConsumer → ReadStream → StreamBase
7.  def bodyStream(): ReadStream[T]

   returns

     a read stream for the body of the message stream.

8.  def clone(): AnyRef
   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @native() @throws( ... )
9.  def completionFuture(): scala.concurrent.Future[Unit]

   Like completionHandler but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

10.  def completionHandler(completionHandler: Handler[AsyncResult[Unit]]): Unit

    Optional method which can be called to indicate when the registration has been propagated across the cluster.

    Optional method which can be called to indicate when the registration has been propagated across the cluster.

    completionHandler

      the completion handler

11.  def endHandler(endHandler: Handler[Unit]): MessageConsumer[T]

    Set an 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.

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      MessageConsumer → ReadStream
12.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
13.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
14.  def exceptionHandler(handler: Handler[Throwable]): MessageConsumer[T]

    Set an exception handler on the read stream.

    Set an exception handler on the read stream.

    handler

      the exception handler

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      MessageConsumer → ReadStream → StreamBase
15.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
16.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
17.  def getMaxBufferedMessages(): Int

    returns

      the maximum number of messages that can be buffered when this stream is paused

18.  def handler(handler: Handler[Message[T]]): MessageConsumer[T]

    Set a data handler.

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

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      MessageConsumer → ReadStream
19.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
20.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
21.  def isRegistered(): Boolean

    returns

      true if the current consumer is registered

22.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
23.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
24.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
25.  def pause(): MessageConsumer[T]

    Pause the `ReadSupport`.

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

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      MessageConsumer → ReadStream
26.  def resume(): MessageConsumer[T]

    Resume reading.

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

    returns

      a reference to this, so the API can be used fluently

    Definition Classes
      MessageConsumer → ReadStream
27.  def setMaxBufferedMessages(maxBufferedMessages: Int): MessageConsumer[T]

    Set the number of messages this registration will buffer when this stream is paused.

    Set the number of messages this registration will buffer when this stream is paused. The default value is `1000`. When a new value is set, buffered messages may be discarded to reach the new value.

    maxBufferedMessages

      the maximum number of messages that can be buffered

    returns

      this registration

28.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
29.  def toString(): String
    Definition Classes
      AnyRef → Any
30.  def unregister(completionHandler: Handler[AsyncResult[Unit]]): Unit

    Unregisters the handler which created this registration

    Unregisters the handler which created this registration

    completionHandler

      the handler called when the unregister is done. For example in a cluster when all nodes of the event bus have been unregistered.

31.  def unregister(): Unit

    Unregisters the handler which created this registration

32.  def unregisterFuture(): scala.concurrent.Future[Unit]

    Like unregister but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

33.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
34.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
35.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @native() @throws( ... )

### Inherited from ReadStream[Message[T]]

### Inherited from StreamBase

### Inherited from AnyRef

### Inherited from Any

### Ungrouped