MemcachedCache

class MemcachedCache[F[_], V](val client: MemcachedClient, val keySanitizer: MemcachedKeySanitizer)(implicit evidence$1: Async[F], val codec: BinaryCodec[V]) extends AbstractCache[F, String, V] with MemcachedTTLConverter

Wrapper around spymemcached

Companion
object
trait AbstractCache[F, String, V]
trait LoggingSupport[F, String]
trait Cache[F, String, V]
class Object
trait Matchable
class Any

Value members

Concrete methods

override
def close: F[Unit]
Definition Classes
Cache

Inherited methods

final override
def caching(key: String)(ttl: Option[Duration])(f: => V)(implicit flags: Flags): F[V]
Definition Classes
AbstractCache -> Cache
Inherited from
AbstractCache
override
def cachingF(key: String)(ttl: Option[Duration])(f: F[V])(implicit flags: Flags): F[V]
Definition Classes
AbstractCache -> Cache
Inherited from
AbstractCache
final override
def get(key: String)(implicit flags: Flags): F[Option[V]]
Definition Classes
AbstractCache -> Cache
Inherited from
AbstractCache
protected
def logCacheHitOrMiss[A](key: String, result: Option[A]): F[Unit]

Output a debug log to record the result of a cache lookup

Output a debug log to record the result of a cache lookup

Type Params
A

the type of the cache value

Value Params
key

the key that was looked up

result

the result of the cache lookup

Inherited from
LoggingSupport
protected
def logCachePut(key: String, ttl: Option[Duration]): F[Unit]

Output a debug log to record a cache insertion/update

Output a debug log to record a cache insertion/update

Value Params
key

the key that was inserted/updated

ttl

the TTL of the inserted entry

Inherited from
LoggingSupport
final override
def put(key: String)(value: V, ttl: Option[Duration])(implicit flags: Flags): F[Unit]
Definition Classes
AbstractCache -> Cache
Inherited from
AbstractCache
final override
def remove(key: String): F[Unit]
Definition Classes
AbstractCache -> Cache
Inherited from
AbstractCache
final override
def removeAll: F[Unit]
Definition Classes
AbstractCache -> Cache
Inherited from
AbstractCache
def toMemcachedExpiry(ttl: Option[Duration])(implicit clock: Clock): Int

Convert an optional Duration to an int suitable for passing to Memcached.

Convert an optional Duration to an int suitable for passing to Memcached.

From the Memcached protocol spec:

The actual value sent may either be Unix time (number of seconds since January 1, 1970, as a 32-bit value), or a number of seconds starting from current time. In the latter case, this number of seconds may not exceed 606024*30 (number of seconds in 30 days); if the number sent by a client is larger than that, the server will consider it to be real Unix time value rather than an offset from current time.

Value Params
ttl

optional TTL

Returns

corresponding Memcached expiry

Inherited from
MemcachedTTLConverter

Concrete fields

val client: MemcachedClient

Implicits

Implicits

implicit
val codec: BinaryCodec[V]