Class/Object

com.metamx.tranquility.tranquilizer

SimpleTranquilizerAdapter

Related Docs: object SimpleTranquilizerAdapter | package tranquilizer

Permalink

class SimpleTranquilizerAdapter[MessageType] extends Logging

Wrap a Tranquilizer, exposing an API that is meant to be easy to use for a single caller that doesn't care exactly what happens with individual messages, but does care about having exceptions and counts reported eventually.

Exceptions are reported from time to time when you call "send", and always when you call "flush". Only one exception will be reported at a time. Note that exceptions triggered by "send" may not necessarily be related to the actual message you passed; they could be from a previous message.

The expected use case of the simple adapter is that if you get an exception from "send" or "flush", you should stop using the adapter and create a new one. It is not meant to make it possible to associate specific exceptions with specific messages.

Calling "start" or "stop" on this adapter will start or stop the underlying Tranquilizer. If you want to start or stop the underlying Tranquilizer yourself, then do not call "start" or "stop" on this adapter.

The expected use case of this class is that it is used by a single thread.

Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SimpleTranquilizerAdapter
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def failedCount: Long

    Permalink

    The number of messages that have failed to send, including drops.

    The number of messages that have failed to send, including drops. This includes drops even if you have disabled reportDropsAsExceptions.

    returns

    failed count

  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def flush(): Unit

    Permalink

    Wait for all pending messages to flush out, and throw an exception if there was one.

    Wait for all pending messages to flush out, and throw an exception if there was one. Blocks until all pending messages are flushed.

  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. lazy val log: Logger

    Permalink
    Definition Classes
    Logging
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def receivedCount: Long

    Permalink

    The number of messages that you've sent to this object so far.

    The number of messages that you've sent to this object so far.

    returns

    received count

  19. def send(message: MessageType): Unit

    Permalink

    Send a message.

    Send a message. The actual send may happen asynchronously. If you must know whether or not there was an exception sending it, call "flush", which will flush all pending messages and throw an exception if there was one.

    This method may throw an exception if there was one, although it is not guaranteed. Furthermore, if this method does throw an exception, it might be for a different message.

  20. def sentCount: Long

    Permalink

    The number of messages that have successfully been sent through the underlying Tranquilizer.

    The number of messages that have successfully been sent through the underlying Tranquilizer.

    returns

    sent count

  21. def start(): Unit

    Permalink
    Annotations
    @LifecycleStart()
  22. def stop(): Unit

    Permalink
    Annotations
    @LifecycleStop()
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped