Created
August 29, 2013 23:11
-
-
Save Narigo/6384526 to your computer and use it in GitHub Desktop.
Pimp My Library example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.vertx.scala.core.eventbus | |
import org.vertx.java.core.eventbus.EventBus | |
import org.vertx.java.core.eventbus.Message | |
class RichEventBus(internal: EventBus) extends EventBus { | |
override def registerHandler[T <: Message[T]](address: String)(handler: T => Unit) = | |
internal.registerHandler(address, handler) | |
override def registerLocalHandler[T <: Message[T]](address: String)(handler: T => Unit) = | |
internal.registerLocalHandler(address, handler) | |
} | |
object RichEventBus { | |
implicit def enrichEventBus(eb: EventBus): RichEventBus = new RichEventBus(eb) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment