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: (Message[JsonObject]) ⇒ PartialFunction[String, BusModReceiveEnd]

    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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def andThen[A](g: (Unit) ⇒ A): (Message[JsonObject]) ⇒ A

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

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

    Definition Classes
    Any
  9. def clone(): AnyRef

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

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

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

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

  14. def finalize(): Unit

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  22. def toString(): String

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. 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