
com.twitter.zipkin.storage.redis.ExpirationSupport.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zipkin-redis Show documentation
Show all versions of zipkin-redis Show documentation
A distributed tracing system
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