io.chrisdavenport.rediculous.RedisTransaction
See theRedisTransaction companion object
Transactions Operate via typeclasses. RedisCtx allows us to abstract our operations into different types depending on the behavior we want. In the case of transactions that is RedisTransaction. These can be composed together via its Applicative instance to form a transaction consisting of multiple commands, then transacted via either multiExec or transact on the class.
In Cluster Mode the first key operation defines the node the entire Transaction will be sent to. Transactions are required to only operate on operations containing keys in the same keyslot, and users are required to hold this imperative or else redis will reject the transaction.
Attributes
- Example:
import io.chrisdavenport.rediculous._ import cats.effect.Concurrent val tx = ( RedisCommands.ping[RedisTransaction], RedisCommands.del[RedisTransaction](List("foo")), RedisCommands.get[RedisTransaction]("foo"), RedisCommands.set[RedisTransaction]("foo", "value"), RedisCommands.get[RedisTransaction]("foo") ).tupled def operation[F[_]: Concurrent] = tx.transact[F]
- Companion:
- object
- Source:
- RedisTransaction.scala
- Graph
- Supertypes