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

com.twitter.zipkin.storage.redis.ExpirationSupport.scala Maven / Gradle / Ivy

The newest version!
package com.twitter.zipkin.storage.redis

import com.twitter.finagle.redis.Client
import com.twitter.util.{Duration, Future}
import org.jboss.netty.buffer.ChannelBuffer

trait ExpirationSupport {
  val client: Client

  /** Expires keys older than this many seconds. */
  val ttl: Option[Duration]

  def expireOnTtl(redisKey: ChannelBuffer): Future[Unit] = {
    if (ttl.isDefined) client.expire(redisKey, ttl.get.inLongSeconds).unit else Future.Unit
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy