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..
- Alphabetic
- By Inheritance
- MessageConsumer
- ReadStream
- StreamBase
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new MessageConsumer(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
address(): String
- returns
The address the handler was registered with.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asJava: AnyRef
- Definition Classes
- MessageConsumer → ReadStream → StreamBase
-
def
bodyStream(): ReadStream[T]
- returns
a read stream for the body of the message stream.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
completionFuture(): scala.concurrent.Future[Unit]
Like completionHandler but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
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
-
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
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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
-
def
fetch(amount: Long): MessageConsumer[T]
Fetch the specified
amount
of elements.Fetch the specified
amount
of elements. If theReadStream
has been paused, reading will recommence with the specifiedamount
of items, otherwise the specifiedamount
will be added to the current stream demand. * @return a reference to this, so the API can be used fluently- Definition Classes
- MessageConsumer → ReadStream
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getMaxBufferedMessages(): Int
- returns
the maximum number of messages that can be buffered when this stream is paused
-
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
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isRegistered(): Boolean
- returns
true if the current consumer is registered
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
pause(): MessageConsumer[T]
Pause the
ReadStream
, it sets the buffer infetch
mode and clears the actual demand.Pause the
ReadStream
, it sets the buffer infetch
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
-
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
-
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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.
-
def
unregister(): Unit
Unregisters the handler which created this registration
-
def
unregisterFuture(): scala.concurrent.Future[Unit]
Like unregister but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )