10000 GitHub - ltp88/scala-cache: Using google guava cache in scala
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ltp88/scala-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

scala-cache

For simple using:

extends SimpleLRUTimeEvictCache and override function loadData

    override protected def loadData(k: K): V = {
        // TODO: Get data code here...
    }

Setting eviction:

    override protected def maxSize: Long = 1000L
    
    override protected def expiredAfterWrite: Option[(Long, TimeUnit)] = Some(5L, TimeUnit.MINUTES)
    
    override protected def expiredAfterAccess: Option[(Long, TimeUnit)] = Some(5L, TimeUnit.MINUTES)

Setting refresh

    override def refreshAfterWrite: Option[(Long, TimeUnit)] = Some(2L, SECONDS)

Removal listening:

    override protected def removal(notification: RemovalNotification[K, V]) = {
        // TODO: handle code here...
    }

Remove:

      protected def remove(k: K)
    
      protected def remove(k: Iterable[K])
    
      protected def removeAll()

About

Using google guava cache in scala

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0