Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release of 5.0.0 #303

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ as well as on your premise.

- [synchronous and asynchronous APIs](#provided-apis)
- [implements standard APIs defined by Play's `cacheApi` project](#provided-apis)
- support of [named caches](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#named-caches)
- [works with Guice](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/40-migration.md#runtime-time-dependency-injection) as well as [compile-time DI](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/40-migration.md#compile-time-dependency-injection)
- [getOrElse and getOrFuture operations](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/30-how-to-use.md#use-of-cacheapi) easing the use
- [wildcards in remove operation](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/30-how-to-use.md#use-of-cacheapi)
- support of collections: [sets](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/30-how-to-use.md#use-of-sets), [lists](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/30-how-to-use.md#use-of-lists), and [maps](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/30-how-to-use.md#use-of-maps)
- [increment and decrement operations](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/30-how-to-use.md#use-of-cacheapi)
- [eager and lazy invocation policies](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#eager-and-lazy-invocation) waiting or not waiting for the result
- several [recovery policies](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#recovery-policy) and possibility of further customization
- support of [several configuration sources](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#running-in-different-environments)
- support of [named caches](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#named-caches)
- [works with Guice](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/40-migration.md#runtime-time-dependency-injection) as well as [compile-time DI](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/40-migration.md#compile-time-dependency-injection)
- [getOrElse and getOrFuture operations](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/30-how-to-use.md#use-of-cacheapi) easing the use
- [wildcards in remove operation](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/30-how-to-use.md#use-of-cacheapi)
- support of collections: [sets](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/30-how-to-use.md#use-of-sets), [lists](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/30-how-to-use.md#use-of-lists), and [maps](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/30-how-to-use.md#use-of-maps)
- [increment and decrement operations](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/30-how-to-use.md#use-of-cacheapi)
- [eager and lazy invocation policies](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#eager-and-lazy-invocation) waiting or not waiting for the result
- several [recovery policies](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#recovery-policy) and possibility of further customization
- support of [several configuration sources](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#running-in-different-environments)
- static in the configuration file
- from the connection string optionally in the environmental variable
- custom implementation of the configuration provider
- support of [standalone, cluster,](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#standalone-vs-cluster)
[aws-cluster,](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#aws-cluster)
and [sentinel modes](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#sentinel)
- build on the top of Pekko actors and serializers, [agnostic to the serialization mechanism](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#limitation-of-data-serialization)
- support of [standalone, cluster,](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#standalone-vs-cluster)
[aws-cluster,](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#aws-cluster)
and [sentinel modes](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#sentinel)
- build on the top of Pekko actors and serializers, [agnostic to the serialization mechanism](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#limitation-of-data-serialization)
- for simplicity, it uses deprecated Java serialization by default
- it is recommended to use [Kryo library](https://github.com/romix/akka-kryo-serialization) or any other mechanism

Expand Down Expand Up @@ -92,11 +92,11 @@ or you can use shortcuts in the table below.

To use this module:

1. [Add this library into your project](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/10-integration.md) and expose APIs
1. See the [configuration options](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md)
1. [Browse examples of use](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/30-how-to-use.md)
1. [Add this library into your project](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/10-integration.md) and expose APIs
1. See the [configuration options](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md)
1. [Browse examples of use](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/30-how-to-use.md)

If you come from older version, you might check the [Migration Guide](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/40-migration.md)
If you come from older version, you might check the [Migration Guide](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/40-migration.md)


## Samples
Expand Down Expand Up @@ -124,15 +124,15 @@ To your SBT `build.sbt` add the following lines:
// enable Play cache API (based on your Play version)
libraryDependencies += play.sbt.PlayImport.cacheApi
// include play-redis library
libraryDependencies += "com.github.karelcemus" %% "play-redis" % "4.0.0"
libraryDependencies += "com.github.karelcemus" %% "play-redis" % "5.0.0"
```


## Compatibility matrix

| play framework | play-redis | documentation |
|----------------|------------------------------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| 3.0.x | <!-- Play 3.0 -->4.0.0<!-- / --> | [see here](https://github.com/KarelCemus/play-redis/blob/4.0.0/README.md) |
| 3.0.x | <!-- Play 3.0 -->5.0.0<!-- / --> | [see here](https://github.com/KarelCemus/play-redis/blob/5.0.0/README.md) |
| 2.9.x | <!-- Play 2.9 -->3.0.0<!-- / --> | [see here](https://github.com/KarelCemus/play-redis/blob/3.0.0/README.md) |
| 2.8.x | <!-- Play 2.8 -->2.7.0<!-- / --> | [see here](https://github.com/KarelCemus/play-redis/blob/2.7.0/README.md) |
| 2.7.x | <!-- Play 2.7 -->2.5.1<!-- / --> | [see here](https://github.com/KarelCemus/play-redis/blob/2.5.1/README.md) |
Expand All @@ -151,7 +151,7 @@ like this library, please feel free to report it or contact me.
## Changelog

For the list of changes and migration guide please see
[the Changelog](https://github.com/KarelCemus/play-redis/blob/4.0.0/CHANGELOG.md).
[the Changelog](https://github.com/KarelCemus/play-redis/blob/5.0.0/CHANGELOG.md).


## Caveat
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ scalacOptions ++= {

ThisBuild / version := "4.0.2"

//enablePlugins(CustomReleasePlugin)
enablePlugins(CustomReleasePlugin)

// exclude from tests coverage
coverageExcludedFiles := ".*exceptions.*"
Expand Down
2 changes: 1 addition & 1 deletion doc/10-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Although the use of runtime-time injection is preferred, both options are equal
// enable Play cache API (based on your Play version)
libraryDependencies += play.sbt.PlayImport.cacheApi
// include play-redis library
libraryDependencies += "com.github.karelcemus" %% "play-redis" % "4.0.0"
libraryDependencies += "com.github.karelcemus" %% "play-redis" % "5.0.0"
```


Expand Down
11 changes: 2 additions & 9 deletions doc/20-configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration

Default configuration and very detailed manual is available in [reference.conf](https://github.com/KarelCemus/play-redis/blob/4.0.0/src/main/resources/reference.conf). It can be overwritten in your `conf/application.conf` file.
Default configuration and very detailed manual is available in [reference.conf](https://github.com/KarelCemus/play-redis/blob/5.0.0/src/main/resources/reference.conf). It can be overwritten in your `conf/application.conf` file.

There are several features supported in the configuration, they are discussed below. However, by default, there is no need for any further configuration. Default settings are set to the standalone instance running on `localhost:6379?db=0`, which is default for redis server. This instance is named `play` but is also exposed as a default implementation.

Expand Down Expand Up @@ -147,7 +147,7 @@ play.cache.redis {

## Named caches

Play framework supports [named caches](https://www.playframework.com/documentation/2.6.x/ScalaCache#Accessing-different-caches) through a qualifier. For a simplicity, the default cache is also exposed without a qualifier to ease the access. This feature can be disabled by `bind-default` property, which defaults to true. The name of the default cache is defined in `default-cache` property, which defaults to `play` to keep consistency with Play framework.
Play framework supports [named caches](https://www.playframework.com/documentation/3.0.x/ScalaCache#Accessing-different-caches) through a qualifier. For a simplicity, the default cache is also exposed without a qualifier to ease the access. This feature can be disabled by `bind-default` property, which defaults to true. The name of the default cache is defined in `default-cache` property, which defaults to `play` to keep consistency with Play framework.

The configuration of each instance is inherited from the `play.cache.redis` configuration. Inherited values may be locally overridden by the instance's own configuration (e.g., `play.cache.redis.instances.myNamedCache`)

Expand Down Expand Up @@ -227,13 +227,6 @@ usually does not apply. However, it is expected the cache should be fast respond
and thus **by default the timeout is set to 500 millis** to avoid unnecessary delays.
This timeout is optional and can be disabled.

### Other timeouts

Other timeouts you might be interested in are related to the communication to Redis, e.g., connection timeout
and receive timeout. These are provided directly by the underlying connector and `play-redis` doesn't affect them.
For more details, see
the [`Redis` configuration](https://github.com/etaty/rediscala).

## Recovery policy

The intention of cache is usually to optimize the application behavior, not to provide any business logic.
Expand Down
10 changes: 5 additions & 5 deletions doc/40-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ changes in public API, which needs your code to be updated.

The invocation policy in `2.0.x` was used as an implicit parameter. Since
`2.1.x` it is a static configurable property inside the instance configuration.
See the [updated documentation for more details](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#eager-and-lazy-invocation).
See the [updated documentation for more details](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#eager-and-lazy-invocation).

### Named caches uses @NamedCache instead of @Named

Expand All @@ -39,7 +39,7 @@ Since `2.1.0`, there is a new `redis-timeout` property. To avoid
ambiguity, the original `timeout` property was renamed to `sync-redis`.
The `timeout` property was deprecated any will be removed in `2.2.0`.

See the updated [documentation for more details](https://github.com/KarelCemus/play-redis/blob/4.0.0/doc/20-configuration.md#eager-and-lazy-invocation).
See the updated [documentation for more details](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#eager-and-lazy-invocation).


## Migration from 1.6.x to 2.0.x
Expand All @@ -50,8 +50,8 @@ The major goal of the 2.0.x version was to support named caches and clean up the

- default database was changed from 1 to 0 (redis default) to remove the inconsistency between play-redis and the redis itself
- the cache instance defined directly under the `play.cache.redis` is a default instance and is named with a default name
- introduced `instances` property to support named caches. See [documentation](https://github.com/KarelCemus/play-redis/blob/2.0.2/doc/20-configuration.md#named-caches) for more details.
- `configuration` property was redesigned and renamed to `source`. Valid values are now `standalone`, `cluster`, `connection-string`, and `custom`. See [documentation](https://github.com/KarelCemus/play-redis/blob/2.0.2/doc/20-configuration.md#standalone-vs-cluster) for more details.
- introduced `instances` property to support named caches. See [documentation](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#named-caches) for more details.
- `configuration` property was redesigned and renamed to `source`. Valid values are now `standalone`, `cluster`, `connection-string`, and `custom`. See [documentation](https://github.com/KarelCemus/play-redis/blob/5.0.0/doc/20-configuration.md#standalone-vs-cluster) for more details.
- `connection-string-variable` was replaced by the `connection-string` property defining the connection string itself. The value is now passed directly into the property through, e.g., `${REDIS_URL}`, which HOCON correctly resolves. This applies when combined with `source: connection-string`.
- `wait` property renamed to `timeout`
- `source`, `timeout`, `dispatcher`, and `recovery` define defaults and may be locally overridden within each named cache configuration.
Expand All @@ -72,7 +72,7 @@ Major redesign of `RedisCacheModule`, however, no changes in use are expected. I

#### Compile-time DI

Major redesign of `RedisCacheComponents`. See the [trait](https://github.com/KarelCemus/play-redis/blob/2.0.0/src/main/scala/play/api/cache/redis/RedisCacheComponents.scala#L14) for details. To create
Major redesign of `RedisCacheComponents`. See the [trait](https://github.com/KarelCemus/play-redis/blob/5.0.0/src/main/scala/play/api/cache/redis/RedisCacheComponents.scala#L14) for details. To create
new API, call `cacheApi( instance )`, where the instance is either a String with the instance name or `RedisInstance` object with a custom configuration. This returns a `RedisCaches` object encapsulating all available APIs. In case of using multiple different APIs, it is suggested to **reuse this object** to prevent the duplicate creation of instances of the same cache connector. To provide a custom instance configuration, either override `redisInstanceResolver` mapping names to the objects or pass the `RedisInstance` object directly to the `cacheApi` call. For custom recovery policy override `recoveryPolicyResolver`.

### Implementation changes
Expand Down
2 changes: 1 addition & 1 deletion project/CustomReleasePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ object CustomReleasePlugin extends AutoPlugin {
val nextVersion = st.extracted.runTask(releaseVersion, st)._2(currentV)
val bump = Version.Bump.Minor

val suggestedReleaseV: String = Version(nextVersion).map(_.bump(bump).unapply).getOrElse(versionFormatError(currentV))
val suggestedReleaseV: String = Version(nextVersion).map(_.bump(bump).string).getOrElse(versionFormatError(currentV))

st.log.info("Press enter to use the default value")

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11")
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")

// linters
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.1")
Expand Down
Loading