-
|
I've read the documentation and tried various methods, but I don't know how I can re-use connections. i use the get method and unsafeToFuture redis info: |
Beta Was this translation helpful? Give feedback.
Answered by
gvolpe
Jun 8, 2023
Replies: 1 comment
-
utf8Api.use { redis =>
buildRestOfYourProgramHere(redis)
}
def buildRestOfYourProgramHere(redis: RedisCommands[IO, String, String]) = ??? This concept is called "shared state" and it applies to many other things. I wrote something about it: https://typelevel.org/blog/2018/06/07/shared-state-in-fp.html |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gvolpe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
utf8Api.use { redis => buildRestOfYourProgramHere(redis) } def buildRestOfYourProgramHere(redis: RedisCommands[IO, String, String]) = ???This concept is called "shared state" and it applies to many other things. I wrote something about it: https://typelevel.org/blog/2018/06/07/shared-state-in-fp.html