Skip to content

Instantly share code, notes, and snippets.

@Narigo
Created August 29, 2013 23:11
Show Gist options
  • Save Narigo/6384526 to your computer and use it in GitHub Desktop.
Save Narigo/6384526 to your computer and use it in GitHub Desktop.
Pimp My Library example
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