-
Notifications
You must be signed in to change notification settings - Fork 63
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
[WIP] exposing RedisEnvironment via environment #739
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,8 +1,15 @@ | ||||||||||||||||||||||||||||
package zio.redis | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
import zio._ | ||||||||||||||||||||||||||||
import zio.schema.codec.BinaryCodec | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
private[redis] trait RedisEnvironment { | ||||||||||||||||||||||||||||
def codec: BinaryCodec | ||||||||||||||||||||||||||||
def executor: RedisExecutor | ||||||||||||||||||||||||||||
final case class RedisEnvironment(codec: BinaryCodec, executor: RedisExecutor) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
private[redis] object RedisEnvironment { | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if this should be private at all now that it's a part of all commands. In fact, I'm thinking if it would be wise to replace it with |
||||||||||||||||||||||||||||
lazy val layer = ZLayer { | ||||||||||||||||||||||||||||
for { | ||||||||||||||||||||||||||||
codec <- ZIO.service[BinaryCodec] | ||||||||||||||||||||||||||||
executor <- ZIO.service[RedisExecutor] | ||||||||||||||||||||||||||||
} yield new RedisEnvironment(codec, executor) | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
Comment on lines
+9
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Super nitpick:
Suggested change
|
||||||||||||||||||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, you may as well remove the
RedisLive
object and pack everything inRedis
, e.g.:In the future we may consider renaming it to
live
, perhaps it'll be more consistent with the ecosystem.