⚠️ PROJECT STATUS: PRE-ALPHA / READ-ONLYThis project is under active development. The API, behavior, and structure are unstable and will change.
Please do not open issues or pull requests at this time. Once the project reaches an initial release, contribution guidelines will be published.
Valkey client built on top of Cats Effect and the async Java client Glide.
import cats.effect.*
import cats.implicits.*
import dev.profunktor.valkey4cats.Valkey
import dev.profunktor.valkey4cats.effect.Log.Stdout.given
object QuickStart extends IOApp.Simple:
val run: IO[Unit] =
Valkey[IO].utf8("valkey://localhost").use: valkey =>
for
_ <- valkey.set("foo", "123")
x <- valkey.get("foo")
_ <- valkey.setNx("foo", "should not happen")
y <- valkey.get("foo")
_ <- IO(assert(x === y))
yield ()Add this to your build.sbt (depends on cats-effect):
libraryDependencies += "dev.profunktor" %% "valkey4cats-effects" % Versionvalkey4cats needs a logger for internal use and provides instances for log4cats. It is the recommended logging library:
libraryDependencies += "dev.profunktor" %% "valkey4cats-log4cats" % VersionThe documentation site is built with Docusaurus and lives in the website/ directory.
cd website
npm install
npm start # dev server at localhost:3000
npm run build # static build to website/build/Start both a single Valkey node and a cluster using docker-compose:
docker-compose up -d
sbt testAllCluster tests run automatically when port 30001 is reachable and are skipped otherwise.
Going forward, features must be compatible with the Valkey OSS project.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.