RedisPartiallyApplied
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Creates a RedisCommands for a cluster connection.
Creates a RedisCommands for a cluster connection.
It will also create an underlying RedisClusterClient to establish connection with Redis.
Example:
Redis[IO].cluster(
RedisCodec.Utf8,
"redis://localhost:30001",
"redis://localhost:30002"
)
Note: if you need to create multiple connections, use either fromClusterClient or fromClusterClientByNode instead, which allows you to re-use the same client.
Attributes
Creates a RedisCommands for a cluster connection to deal with UTF-8 encoded keys and values.
Creates a RedisCommands for a cluster connection to deal with UTF-8 encoded keys and values.
It will also create an underlying RedisClusterClient to establish connection with Redis.
Example:
Redis[IO].clusterUtf8(
"redis://localhost:30001",
"redis://localhost:30002"
)
Note: if you need to create multiple connections, use either fromClusterClient or fromClusterClientByNode instead, which allows you to re-use the same client.
Attributes
Creates a RedisCommands for a single-node connection.
Creates a RedisCommands for a single-node connection.
It will create an underlying RedisClient using the supplied client options and config to establish connection with Redis. Can be used to customise advanced features like metric recording or shutdown delays.
Example:
for {
opts <- Resource.eval(Sync[F].delay(ClientOptions.create())) // configure timeouts, etc
config = Redis4CatsConfig()
cmds <- Redis[IO].custom("redis://localhost", opts, config, RedisCodec.Ascii)
} yield cmds
Note: if you need to create multiple connections, use fromClient instead, which allows you to re-use the same client.
Attributes
Creates a RedisCommands for a single-node connection.
Creates a RedisCommands for a single-node connection.
Example:
val redis: Resource[IO, RedisCommands[IO, String, String]] =
for {
uri <- Resource.eval(RedisURI.make[IO]("redis://localhost"))
cli <- RedisClient[IO](uri)
cmd <- Redis[IO].fromClient(cli, RedisCodec.Utf8)
} yield cmd
Note: if you don't need to create multiple connections, you might prefer to use either utf8 or simple instead.
Attributes
Creates a RedisCommands for a cluster connection
Creates a RedisCommands for a cluster connection
Example:
val redis: Resource[IO, RedisCommands[IO, String, String]] =
for {
uris <- Resource.eval(
List("redis://localhost:30001", "redis://localhost:30002")
.traverse(RedisURI.make[F](_))
)
cli <- RedisClusterClient[IO](uris: _*)
cmd <- Redis[IO].fromClusterClient(cli, RedisCodec.Utf8)
} yield cmd
Note: if you don't need to create multiple connections, you might prefer to use either clusterUtf8 or cluster instead.
Attributes
Creates a RedisCommands by trying to establish a cluster connection to the specified node.
Creates a RedisCommands by trying to establish a cluster connection to the specified node.
Example:
val redis: Resource[IO, RedisCommands[IO, String, String]] =
for {
uris <- Resource.eval(
List("redis://localhost:30001", "redis://localhost:30002")
.traverse(RedisURI.make[F](_))
)
cli <- RedisClusterClient[IO](uris: _*)
cmd <- Redis[IO].fromClusterClientByNode(cli, RedisCodec.Utf8, NodeId("1"))
} yield cmd
Note: if you don't need to create multiple connections, you might prefer to use either clusterUtf8 or cluster instead.
Attributes
Creates a RedisCommands from a MasterReplica connection
Creates a RedisCommands from a MasterReplica connection
Example:
val redis: Resource[IO, RedisCommands[IO, String, String]] =
for {
uri <- Resource.eval(RedisURI.make[IO](redisURI))
conn <- RedisMasterReplica[IO].make(RedisCodec.Utf8, uri)(Some(ReadFrom.MasterPreferred))
cmds <- Redis[IO].masterReplica(conn)
} yield cmds
Attributes
Creates a RedisCommands for a single-node connection.
Creates a RedisCommands for a single-node connection.
It will create an underlying RedisClient with default options to establish connection with Redis.
Example:
Redis[IO].simple("redis://localhost", RedisCodec.Ascii)
Note: if you need to create multiple connections, use fromClient instead, which allows you to re-use the same client.
Attributes
Creates a RedisCommands for a single-node connection to deal with UTF-8 encoded keys and values.
Creates a RedisCommands for a single-node connection to deal with UTF-8 encoded keys and values.
It will create an underlying RedisClient with default options to establish connection with Redis.
Example:
Redis[IO].utf8("redis://localhost")
Note: if you need to create multiple connections, use fromClient instead, which allows you to re-use the same client.
Attributes
Creates a RedisCommands for a single-node connection.
Creates a RedisCommands for a single-node connection.
It will create an underlying RedisClient using the supplied client options to establish connection with Redis.
Example:
for {
opts <- Resource.eval(Sync[F].delay(ClientOptions.create())) // configure timeouts, etc
cmds <- Redis[IO].withOptions("redis://localhost", opts, RedisCodec.Ascii)
} yield cmds
Note: if you need to create multiple connections, use fromClient instead, which allows you to re-use the same client.