com.github.jeanadrien.gatling.mqtt.client.Callback.scala Maven / Gradle / Ivy
The newest version!
package com.github.jeanadrien.gatling.mqtt.client
import com.typesafe.scalalogging.StrictLogging
/**
*
*/
private[client] object Callback extends StrictLogging {
class HalfCallback[T](val onSuccessFn : T => Unit) {
def onFailure(onFailureFn : Throwable => Unit) = new org.fusesource.mqtt.client.Callback[T] {
override def onSuccess(void : T) : Unit = onSuccessFn(void)
override def onFailure(value : Throwable) : Unit = onFailureFn(value)
}
}
def onSuccess[T](onSuccessFn : T => Unit) = new HalfCallback[T](onSuccessFn)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy