gfc-cache


License

License

Apache-style
GroupId

GroupId

com.gilt
ArtifactId

ArtifactId

gfc-cache_2.10
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

gfc-cache
gfc-cache
Project Organization

Project Organization

com.gilt

Download gfc-cache_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/com.gilt/gfc-cache_2.10/ -->
<dependency>
    <groupId>com.gilt</groupId>
    <artifactId>gfc-cache_2.10</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.gilt/gfc-cache_2.10/
implementation 'com.gilt:gfc-cache_2.10:0.1.0'
// https://jarcasting.com/artifacts/com.gilt/gfc-cache_2.10/
implementation ("com.gilt:gfc-cache_2.10:0.1.0")
'com.gilt:gfc-cache_2.10:jar:0.1.0'
<dependency org="com.gilt" name="gfc-cache_2.10" rev="0.1.0">
  <artifact name="gfc-cache_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.gilt', module='gfc-cache_2.10', version='0.1.0')
)
libraryDependencies += "com.gilt" % "gfc-cache_2.10" % "0.1.0"
[com.gilt/gfc-cache_2.10 "0.1.0"]

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.6
com.gilt : gfc-time_2.10 jar 0.0.7
com.gilt : gfc-concurrent_2.10 jar 0.3.6
com.gilt : gfc-logging_2.10 jar 0.0.8
com.gilt : gfc-util_2.10 jar 0.1.7
com.gilt : gfc-guava_2.10 jar 0.3.0

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 3.0.4
org.mockito : mockito-all jar 1.10.19

Project Modules

There are no modules declared in this project.

gfc-cache Maven Central Build Status Coverage Status Join the chat at https://gitter.im/gilt/gfc

A library that contains scala caching helper code. Part of the Gilt Foundation Classes.

Getting gfc-cache

The latest version is 0.1.0, which is cross-built against Scala 2.10.x, 2.11.x and 2.12.x.

If you're using SBT, add the following line to your build file:

libraryDependencies += "com.gilt" %% "gfc-cache" % "0.1.0"

For Maven and other build tools, you can visit search.maven.org. (This search will also list other available libraries from the gilt fundation classes.)

Contents and Example Usage

com.gilt.gfc.cache.AsyncCache & AsyncCacheImpl

AsyncCache represents an asynchronous cache. It may not contain the whole data, and will return Future[Option[V]] to show that the value may be lazy-loaded by issuing a remote call.

AsyncCacheImpl is an implementation of AsyncCache that adds build-load functionality, which requires a load function to be implemented, which is called on cache-miss.

com.gilt.gfc.cache.SyncCache & SyncCacheImpl

SyncCache represents an in-memory cache, returning values as Option[V] indicating that no values are lazy-loaded on cache-miss.

SyncCacheImpl is an implementation of SyncCache that adds build-load functionality, which requires a load function to be implemented, which is called on cache-miss.

com.gilt.gfc.cache.CacheConfiguration

Mix in this trait to provide configuration for the cache. The following parameters are needed:

  • refreshPeriodMs: how often to reload the cache, in millis.
  • cacheInitStrategy: how to initialize the cache, either synchronously or asynchronously.

Code coverage report

$ sbt clean coverage test coverageReport

License

Copyright 2018 Gilt Groupe, Inc. & HBC Digital.

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

com.gilt

Gilt Tech

Versions

Version
0.1.0
0.0.3
0.0.2
0.0.1