All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tanukkii.reactivezk.DeleteAsyncCallback.scala Maven / Gradle / Ivy

package tanukkii.reactivezk

import akka.actor.{Actor, ActorRef}
import tanukkii.reactivezk.ZKOperations.{DeleteFailure, Deleted}

trait DeleteAsyncCallback {
  import KeeperExceptionConverter._

  def deleteAsyncCallback(implicit sender: ActorRef = Actor.noSender): (Int, String, ContextEnvelope) => Unit = {
    (rc: Int, path: String, ctx: ContextEnvelope) => rc.toKeeperExceptionOpt(path) match {
      case None => ctx.sender ! Deleted(path, ctx.originalCtx)
      case Some(e) => ctx.sender ! DeleteFailure(e, path, ctx.originalCtx)
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy