Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦境迷离
Zio Redis
提交
81e42960
Z
Zio Redis
项目概览
梦境迷离
/
Zio Redis
9 个月 前同步成功
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
Zio Redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
81e42960
编写于
12月 29, 2022
作者:
G
github-actions[bot]
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update README.md
上级
9525df58
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
89 addition
and
18 deletion
+89
-18
README.md
README.md
+89
-18
未找到文件。
README.md
浏览文件 @
81e42960
# ZIO Redis
[
//
]:
#
(This file was autogenerated using `zio-sbt-website` plugin via `sbt generateReadme` command.)
[
//
]:
#
(So please do not edit it manually. Instead, change "docs/index.md" file or sbt setting keys)
[
//
]:
#
(e.g. "readmeDocumentation" and "readmeSupport".)
| Project Stage | CI | Release | Snapshot | Discord |
# ZIO Redis
| --- | --- | --- | --- | --- |
|
[
![Project stage
][
Stage
]
]
[
Stage-Page] | ![CI
][
Badge-CI
]
|
[
![Release Artifacts
][
Badge-SonatypeReleases
]
]
[
Link-SonatypeReleases] | [![Snapshot Artifacts
][
Badge-SonatypeSnapshots
]
]
[
Link-SonatypeSnapshots] | [![Discord
][
Badge-Discord
]
][Link-Discord] |
ZIO Redis is a type-safe, performant,
ZIO native Redis client.
[
ZIO Redis
](
https://github.com/zio/zio-redis
)
is a
ZIO native Redis client.
> The client is still a work-in-progress. Watch this space!
> The client is still a work-in-progress. Watch this space!
# Documentation
|Project Stage | CI | Release | Snapshot | Discord | Github |
|--------------|----|---------|----------|---------|--------|
|
[
![Experimental
](
https://img.shields.io/badge/Project%20Stage-Experimental-yellowgreen.svg
)
](https://github.com/zio/zio/wiki/Project-Stages) |!
[
CI Badge
](
https://github.com/zio/zio-redis/workflows/CI/badge.svg
)
|
[
![Sonatype Releases
](
https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-redis_2.12.svg
)
](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-redis_2.12/) |
[
![Sonatype Snapshots
](
https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-redis_2.12.svg
)
](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-redis_2.12/) |
[
![Chat on Discord!
](
https://img.shields.io/discord/629491597070827530?logo=discord
)
](https://discord.gg/2ccFBr4) |
[
![ZIO Redis
](
https://img.shields.io/github/stars/zio/zio-redis?style=social
)
](https://github.com/zio/zio-redis) |
## Introduction
ZIO Redis is in the experimental phase of development, but its goals are:
-
**Type Safety**
-
**Performance**
-
**Minimum Dependency**
-
**ZIO Native**
## Installation
Since the ZIO Redis is in the experimental phase, it is not released yet, but we can use snapshots:
```
scala
libraryDependencies
+=
"dev.zio"
%%
"zio-redis"
%
"0.0.0+457-9525df58-SNAPSHOT"
```
## Example
To execute our ZIO Redis effect, we should provide the
`RedisExecutor`
layer to that effect. To create this layer we
should also provide the following layers:
-
**RedisConfig**
— Using default one, will connect to the
`localhost:6379`
Redis instance.
-
**BinaryCodec**
— In this example, we are going to use the built-in
`ProtobufCodec`
codec from zio-schema project.
To run this example we should put following dependencies in our
`build.sbt`
file:
```
scala
libraryDependencies
++=
Seq
(
"dev.zio"
%%
"zio-redis"
%
"0.0.0+457-9525df58-SNAPSHOT"
,
"dev.zio"
%%
"zio-schema-protobuf"
%
"0.3.0"
)
```
Learn more on the
[
ZIO Redis Homepage
](
https://zio.dev/zio-redis/
)
!
```
scala
import
zio._
import
zio.redis._
import
zio.schema.codec._
object
ZIORedisExample
extends
ZIOAppDefault
{
val
myApp
:
ZIO
[
Redis
,
RedisError
,
Unit
]
=
for
{
_
<-
set
(
"myKey"
,
8L
,
Some
(
1.
minutes
))
v
<-
get
(
"myKey"
).
returning
[
Long
]
_
<-
Console
.
printLine
(
s
"Value of myKey: $v"
).
orDie
_
<-
hSet
(
"myHash"
,
(
"k1"
,
6
),
(
"k2"
,
2
))
_
<-
rPush
(
"myList"
,
1
,
2
,
3
,
4
)
_
<-
sAdd
(
"mySet"
,
"a"
,
"b"
,
"a"
,
"c"
)
}
yield
()
override
def
run
=
myApp
.
provide
(
RedisLive
.
layer
,
RedisExecutor
.
layer
,
ZLayer
.
succeed
(
RedisConfig
.
Default
),
ZLayer
.
succeed
[
BinaryCodec
](
ProtobufCodec
)
)
}
```
## Resources
-
[
ZIO Redis
](
https://www.youtube.com/watch?v=yqFt3b3RBkI
)
by Dejan Mijic — Redis is one of the most commonly used
in-memory data structure stores. In this talk, Dejan will introduce ZIO Redis, a purely functional, strongly typed
client library backed by ZIO, with excellent performance and extensive support for nearly all of Redis' features. He
will explain the library design using the bottom-up approach - from communication protocol to public APIs. Finally, he
will wrap the talk by demonstrating the client's usage and discussing its performance characteristics.
## Documentation
Learn more on the
[
ZIO Redis homepage
](
https://zio.dev/zio-redis/
)
!
## Contributing
For the general guidelines, see ZIO
[
contributor's guide
](
https://zio.dev/about/contributing
)
.
## Code of Conduct
See the
[
Code of Conduct
](
https://zio.dev/about/code-of-conduct
)
## Support
## Support
Come chat with us on
[
![Badge-Discord]
][
Link-Discord
]
.
Come chat with us on
[
![Badge-Discord]
][
Link-Discord
]
.
# License
[
Badge-Discord
]:
https://img.shields.io/discord/629491597070827530?logo=discord
"chat on discord"
[
Link-Discord
]:
https://discord.gg/2ccFBr4
"Discord"
[
License
](
LICENSE
)
## License
[
Badge-CI
]:
https://github.com/zio/zio-redis/workflows/CI/badge.svg
[
License
](
LICENSE
)
[
Badge-Discord
]:
https://img.shields.io/discord/629491597070827530?logo=discord
[
Badge-SonatypeReleases
]:
https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-redis_2.12.svg
[
Badge-SonatypeSnapshots
]:
https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-redis_2.12.svg
[
Link-Discord
]:
https://discord.gg/2ccFBr4
[
Link-SonatypeReleases
]:
https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-redis_2.12/
[
Link-SonatypeSnapshots
]:
https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-redis_2.12/
[
Stage
]:
https://img.shields.io/badge/Project%20Stage-Experimental-yellow.svg
[
Stage-Page
]:
https://github.com/zio/zio/wiki/Project-Stages
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录