org.vertx.scala.mods

ScalaBusMod

trait ScalaBusMod extends (Message[JsonObject]) ⇒ Unit with VertxAccess

Extend this trait to get an easy to use interface for your EventBus module. It relies on the sender sending JSON requests with an {"action":"<something>"}. It will reply with either a {"status":"ok"} JSON object or an {"status":"error", "error":"<ERROR_CODE>", "message":"<detailed message of error>"}. You can provide extra fields in your reply, by adding a JsonObject to your reply (Ok or Error). If you need to do something asynchronously while processing the message, use AsyncReply. You just need to map the Future to one of the Ok or Error replies. Exceptions that you forget to catch will always yield a "MODULE_EXCEPTION" error code.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ScalaBusMod
  2. VertxAccess
  3. Function1
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract val container: Container

    Definition Classes
    VertxAccess
  2. abstract val logger: Logger

    Definition Classes
    VertxAccess
  3. abstract def receive: Receive

    Override this method to handle a message received via the eventbus.

    Override this method to handle a message received via the eventbus. This function reads the action parameter out of the message and checks if the returned PartialFunction is defined on it. With the returned BusModReply, you can easily tell whether the message resulted in an error or everything went well by replying Ok.

    returns

    A partial function consisting of an "action" -> BusModReply.

  4. abstract val vertx: Vertx

    Definition Classes
    VertxAccess

Concrete 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 andThen[A](g: (Unit) ⇒ A): (Message[JsonObject]) ⇒ A

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. final def apply(msg: Message[JsonObject]): Unit

    Definition Classes
    ScalaBusMod → Function1
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def compose[A](g: (A) ⇒ Message[JsonObject]): (A) ⇒ Unit

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  9. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  11. implicit val executionContext: ExecutionContext

    Definition Classes
    ScalaBusModVertxAccess
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    Function1 → AnyRef → Any
  21. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from VertxAccess

Inherited from (Message[JsonObject]) ⇒ Unit

Inherited from AnyRef

Inherited from Any

Ungrouped