vertx-lang-scala-docs_2.12 3.8.0 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
- DeliveryContext
- DeliveryOptions
- EventBus
- EventBusOptions
- Message
- MessageConsumer
- MessageProducer

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. * @param 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. * @return 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. * @param handler the exception handler

    returns

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

    Definition Classes
      MessageConsumer → ReadStream → StreamBase
15.  def fetch(amount: Long): MessageConsumer[T]

    Fetch the specified `amount` of elements.

    Fetch the specified `amount` of elements. If the `ReadStream` has been paused, reading will recommence with the specified `amount` of items, otherwise the specified `amount` will be added to the current stream demand. * @return a reference to this, so the API can be used fluently

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

    returns

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

19.  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. * @return a reference to this, so the API can be used fluently

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

    returns

      true if the current consumer is registered

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

    Pause the `ReadStream`, it sets the buffer in `fetch` mode and clears the actual demand.

    Pause the `ReadStream`, it sets the buffer in `fetch` mode and clears the actual demand.

    While it's paused, no data will be sent to the data `handler`. * @return a reference to this, so the API can be used fluently

    Definition Classes
      MessageConsumer → ReadStream
27.  def pipe(): Pipe[Message[T]]

    Pause this stream and return a to transfer the elements of this stream to a destination .

    Pause this stream and return a to transfer the elements of this stream to a destination .

    The stream will be resumed when the pipe will be wired to a `WriteStream`. * @return a pipe

    Definition Classes
      MessageConsumer → ReadStream
28.  def pipeTo(dst: WriteStream[Message[T]], handler: Handler[AsyncResult[Unit]]): Unit

    Pipe this `ReadStream` to the `WriteStream`.

    Pipe this `ReadStream` to the `WriteStream`.

    Elements emitted by this stream will be written to the write stream until this stream ends or fails.

    Once this stream has ended or failed, the write stream will be ended and the `handler` will be called with the result. * @param dst the destination write stream

    Definition Classes
      MessageConsumer → ReadStream
29.  def pipeTo(dst: WriteStream[Message[T]]): Unit

    Like io.vertx.scala.core.streams.ReadStream#pipeTo but with no completion handler.

    Like io.vertx.scala.core.streams.ReadStream#pipeTo but with no completion handler.

    Definition Classes
      MessageConsumer → ReadStream
30.  def pipeToFuture(dst: WriteStream[Message[T]]): scala.concurrent.Future[Unit]

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

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

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

    Resume reading, and sets the buffer in `flowing` mode.

    Resume reading, and sets the buffer in `flowing` mode.

    If the `ReadStream` has been paused, reading will recommence on it. * @return a reference to this, so the API can be used fluently

    Definition Classes
      MessageConsumer → ReadStream
32.  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. The most recent messages will be kept. * @param maxBufferedMessages the maximum number of messages that can be buffered

    returns

      this registration

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

    Unregisters the handler which created this registration * @param completionHandler the handler called when the unregister is done.

    Unregisters the handler which created this registration * @param completionHandler the handler called when the unregister is done. For example in a cluster when all nodes of the event bus have been unregistered.

36.  def unregister(): Unit

    Unregisters the handler which created this registration

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

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

38.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
39.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
40.  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