Releases: profunktor/redis4cats
v0.13.0
Cross-built against Cats Effect 2, and Scala 2.12.x, 2.13.x and 3.0.0-RC1.
🚀 Changes
🤖 Dependency Updates
- Update fs2-core to 2.5.4 (#512) @scala-steward
- Update sbt-dotty to 0.5.4 (#509) @scala-steward
- Update cats-effect to 2.4.1 (#506) @scala-steward
- Update cats-core, cats-testkit to 2.5.0 (#505) @scala-steward
- Update munit, munit-scalacheck to 0.7.23 (#503) @scala-steward
- Update log4cats-core, log4cats-slf4j to 1.2.1 (#500) @scala-steward
- Update sbt-ci-release to 1.5.7 (#499) @scala-steward
- Update lettuce-core to 6.0.3.RELEASE (#496) @scala-steward
v1.0.0-RC1
This is the first release candidate with support for Cats Effect 3, thanks to @bplommer for the hard work!
The 1.x.x
series will continue to be built against CE3, whereas the current stable 0.x.x
series will be built against CE2.
🚀 Changes
- Update to cats-effect 3 (#484) @bplommer
- Drop scala2 compiler plugins in preparation for Scala 3 (#485) @bplommer
- Fix log4cats adapter (#494) @catostrophe
🔧 Internal Changes
🤖 Dependency Updates
- Update sbt-ci-release to 1.5.6 (#489) @scala-steward
- Update sbt to 1.4.9 (#488) @scala-steward
v0.12.0
v0.12.1
breaks binary compatibility, you should stay on v0.12.0
if this is important to you. Otherwise, use v0.13.1
.
🚀 Changes
- Remove direct usage of Blocker to ease CE3 transition (#479) @bplommer
- Improving zRemRangeByScore method interface (#469) @kerzok
- Pass Lettuce ReadFrom option to cluster connection (#455) @mmienko
- XREAD id should be the last consumed one (no increment) (#449) @epifab
- Asynchronous XREAD to prevent constant polling of redis streams (#447) @epifab
🤖 Dependency Updates
v0.11.1
🚀 Changes
This greatly improves transactions and pipelines' performance while also making them deterministic.
🤖 Dependency Updates
- Update sbt to 1.4.6 (#443) @scala-steward
- Update sbt-microsites to 1.3.0 (#442) @scala-steward
- Update fs2-core to 2.5.0 (#441) @scala-steward
- Update munit, munit-scalacheck to 0.7.20 (#438) @scala-steward
- Update cats-core, cats-effect, cats-testkit to 2.3.1 (#440) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.14 (#439) @scala-steward
v0.11.0
🚀 Changes
Lots of great contributions in this release, thanks to all the contributors ❤️ !
- Fix canceled transactions (#435) @gvolpe
- Fix transactions with optimistic lock (WATCH) (#389) @gvolpe
- Add auth command (#427) @mmienko
- Add more scripting commands (#429) @mmienko
- Unvoid hash commands (#428) @mmienko
- Fix ZCOUNT signature (#409) @ghostdogpr
- Add HyperLogLog Redis Commands (#406) @andimiller
- Keep the results of set update commands (#397) @sergkh
- Support refresh of the redis cluster topology view (#384) @cosminci
- Cluster compatible scan (#387) @sshobotov
- PubSub.mkConnection using resource (#388) @sshobotov
- Unvoid list and keys (#378) @mmienko
- Unvoid list push cmds (#374) @mmienko
- Add
select
to ConnectionCommands (#370) @ikempf
🔧 Internal Changes
- Update sbt script version (#436) @gvolpe
- CI: Release drafter (#432) @gvolpe
- Nixify CI build (#430) @gvolpe
- Improve ttl implementations (#421) @gvolpe
📗 Documentation
- Fix pipelining test + add caveats documentation (#433) @gvolpe
- Added example of how to setup more fine tuned redis cluster connection (#393) @sshobotov
🤖 Dependency Updates
- Update cats-core to 2.3.0 (#431) @gvolpe
- Update sbt-ci-release to 1.5.5 (#426) @scala-steward
- Update sbt-tpolecat to 0.1.16 (#425) @scala-steward
- Update kind-projector to 0.11.2 (#424) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.13 (#419) @scala-steward
- Update munit, munit-scalacheck to 0.7.19 (#418) @scala-steward
- Update fs2-core to 2.4.6 (#417) @scala-steward
- Update sbt to 1.4.4 (#416) @scala-steward
- Update to Redis 6.0.8 (#415) @gvolpe
- Update sbt-site to 1.4.1 (#399) @scala-steward
- Update lettuce-core to 6.0.1.RELEASE (#395) @scala-steward
- Updates io.lettuce:lettuce-core from 5.3.4.RELEASE to 6.0.0.RELEASE. (#379) @mmienko
v0.10.3
Changes
According to git shortlog v0.10.2.. --no-merges
:
Arturas Slajus (2) @arturaz:
- #365 Fix: hmGet throws an exception if one of the keys doesn't have a value
- #366 Add hmGet to the tests.
Gabriel Volpe (6) @gvolpe:
Pierre Ricadat (5) @ghostdogpr:
- #328 Return MessageId in append
- #329 Add Streaming constructors that return a Resource
- #342 Properly split entry IDs
- #343 Increment sequence number instead of timestamp to get the next offset
quanganhtran (2) @quanganhtran:
zakolenko (3) @zakolenko:
- #348 sorted sets: zpopmin, zpopmax, bzpopmin, bzpopmax
- #349
blpop
andbrpop
: - returnF[Option[(K, V)]]
instead of F[(K, V)] - accept a non-empty list of keys bzpopmin
,bzpopmax
: acceptDuration
instead ofFiniteDuration
Dependency updates
Scala Steward (15):
- Update sbt-scalafmt to 2.4.2
- Update fs2-core to 2.4.4
- Update munit, munit-scalacheck to 0.7.12
- Update cats-core, cats-testkit to 2.2.0
- Update cats-effect to 2.2.0
- Update sbt-mdoc to 2.2.7
- Update lettuce-core to 5.3.4.RELEASE
v0.10.2
Changes
A single change (forgotten in the previous release)
- #327 Simplify creation of
RedisClient
Previous changes
The tag description on v0.10.1
was messed up so here it is.
Gabriel Volpe (11):
Examples: Concurrent transactions with optimistic locking [5d703e0]
filterExec instead of exec [75ed8fc]
Automated microsite publishing using Nix (#305) [c385285]
Debug-level logging for transactions and pipelining [235160f]
Scala Steward (14):
Update lettuce-core to 5.3.1.RELEASE [f0cca46]
Update munit, munit-scalacheck to 0.7.9 [9e120bc]
Update fs2-core to 2.4.2 [bb5fce0]
Update sbt-mdoc to 2.2.3 [00c523f]
Update sbt-tpolecat to 0.1.13 [6e34081]
Update sbt to 1.3.13 [fa6c9f3]
Tomasz Szymula (3):
add xadd xtrim ~ optional param [35788fc]
change streaming api messages explicitly do xadd/xread + support approxMaxlen param [51da947]
Yannick Heiber (3):
Add Redis4CatsConfig with ability to control shutdown timeouts [caf577c]
Simplify RedisClusterClient.apply [75afff0]
v0.10.0
Breaking changes
A lot has changed since the latest major release 0.9.6
for a greater good. Here's a summary of changes.
Package rename
Before | Now |
---|---|
dev.profunktor.redis4cats.algebra.RedisCommands |
dev.profunktor.redis4cats.RedisCommands |
dev.profunktor.redis4cats.interpreter.Redis |
dev.profunktor.redis4cats.Redis |
dev.profunktor.redis4cats.domain._ |
dev.profunktor.redis4cats.data._ |
dev.profunktor.redis4cats.interpreter.pubsub.PubSub |
dev.profunktor.redis4cats.pubsub.PubSub |
dev.profunktor.redis4cats.interpreter.streams.RedisStream |
dev.profunktor.redis4cats.streams.RedisStream |
dev.profunktor.redis4cats.streams._ |
dev.profunktor.redis4cats.pubsub.data._ (*) |
dev.profunktor.redis4cats.streams._ |
dev.profunktor.redis4cats.streams.data._ (*) |
(*) It has been split into two different files.
Typed-transactions & Pipelining
Typed-transactions and pipelining now make use of a custom HList
s. Types are now fully inferred. For example:
//type Cmd = IO[Unit] :: IO[Unit] :: IO[Option[String]] :: IO[Unit] :: IO[Unit] :: IO[Option[String]] :: HNil
val operations =
cmd.set(key1, "sad") :: cmd.set(key2, "windows") :: cmd.get(key1) ::
cmd.set(key1, "nix") :: cmd.set(key2, "linux") :: cmd.get(key1) :: HNil
//type Res = Option[String] :: Option[String] :: HNil
val prog =
RedisTransaction(cmd)
.filterExec(operations)
.flatMap {
case res1 ~: res2 ~: HNil =>
putStrLn(s"res1: $res1, res2: $res2")
}
.onError {
case TransactionAborted =>
putStrLn("[Error] - Transaction Aborted")
case TransactionDiscarded =>
putStrLn("[Error] - Transaction Discarded")
case _: TimeoutException =>
putStrLn("[Error] - Timeout")
}
Redis client configuration
A RedisClient
can now be configured (timeouts, reconnection, etc) by supplying a ClientOptions
. E.g.
import io.lettuce.core.{ ClientOptions, TimeoutOptions }
import java.time.Duration
val mkOpts: IO[ClientOptions] =
IO {
ClientOptions.builder()
.autoReconnect(false)
.pingBeforeActivateConnection(false)
.timeoutOptions(
TimeoutOptions.builder()
.fixedTimeout(Duration.ofSeconds(10))
.build()
)
.build()
}
val api: Resource[IO, StringCommands[IO, String, String]] =
for {
uri <- Resource.liftF(RedisURI.make[IO]("redis://localhost"))
opts <- Resource.liftF(mkOpts)
client <- RedisClient[IO](uri, opts)
redis <- Redis[IO].fromClient(client, stringCodec)
} yield redis
New constructors
Redis[IO].utf8("redis://localhost")
Redis[IO].simple("redis://localhost", longCodec)
Redis[IO].clusterUtf8("redis://localhost:30001")
Redis[IO].cluster("redis://localhost:30001", someCodec)
This greatly simplifies the creation of RedisCommands[F, K, V]
while improving type inference (note that K
and V
are inferred from the codec passed as an argument) thanks to the partially applied trick.
Some new constructors now take a ClientOptions
argument as well.
Redis[IO].withOptions("redis://localhost", opts, codec)
RedisClient[IO](uri, opts)
RedisMasterReplica[IO].withOptions(codec, uri, opts)
Quick start
A new quick start section has been added to the documentation:
import cats.effect._
import cats.implicits._
import dev.profunktor.redis4cats.Redis
import dev.profunktor.redis4cats.effect.Log.NoOp._
object QuickStart extends IOApp {
override def run(args: List[String]): IO[ExitCode] =
Redis[IO].utf8("redis://localhost").use { cmd =>
for {
_ <- cmd.set("foo", "123")
x <- cmd.get("foo")
_ <- cmd.setNx("foo", "should not happen")
y <- cmd.get("foo")
_ <- IO(println(x === y)) // true
} yield ExitCode.Success
}
}
Codecs derivation
Codecs can now derive key types K
in addition to value types V
. For example:
import dev.profunktor.redis4cats.codecs.Codecs
import dev.profunktor.redis4cats.codecs.splits._
import dev.profunktor.redis4cats.data.RedisCodec
case class Keys(value: String)
val keysSplitEpi: SplitEpi[String, Keys] =
SplitEpi(Keys.apply, _.value)
val newCodec: RedisCodec[Keys, Long] =
Codecs.derive(RedisCodec.Utf8, keysSplitEpi, stringLongEpi)
Compression & Encryption codecs
Three new functions have been added to manipulate existing codecs: deflate
, gzip
, and secure
. E.g.
import dev.profunktor.redis4cats.data.RedisCodec
val gzipCodec: RedisCodec[String, String] =
RedisCodec.gzip(RedisCodec.Utf8)
All Changes
- #245 [Feature] - Scan command impl by @oskin1
- #248 [Docs] - Rename fs2-redis to redis4cats by @zaneli
- #252 [Docs] - Add documentation section to README by @ybasket
- #269 [Bugfix] - Fix bugs in
zRevRangeWithScores
andzRevRangeByScoreWithScores
by @taeguk - #273 [Feature] - Typed transactions using custom HList
- #276 [Refactor] - Simpler package naming
- #277 [Feature] - Pipelining using HLists
- #278 [Feature] - Filter Unit types from HList
- #283 [Refactor] - The
exec_
function has been renamed tofilterExec
(transactions and pipelining). - #284 [Refactor] - The API has been greatly simplified while also improving type inference
- #285 [Refactor] - Rename Redis instantiation methods (
make
=>fromClient
, etc) by @ybasket - #289 [Docs] - Scaladocs as part of the microsite: https://redis4cats.profunktor.dev/api/
- #292 [Internal] - Migrating tests over to
MUnit
- #293 [Feature] - Stdout logging implementation + docs
- #295 [Docs] - Codecs documentation (including JsonCodec)
- #296 [Feature] - Codecs: compression, encryption & docs
- #297 [Feature] - Client options (to configure the underlying Redis client: timeouts, reconnection, etc)
- #298 [Internal] - Automating releases from the CI build
- #299 [Internal] - CI build Dhall definitions
- #300 [Refactor] - Removing
liftK
from the commands algebra
Dependency updates
Thanks to all the contributors! 🎉
v0.10.0-RC5
Testing the automated release process (2).
v0.10.0-RC4
Testing the automated release process.