RedisTransaction

final case
class RedisTransaction[A](value: RedisTxState[Queued[A]])

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.

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
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def transact[F[_] : Concurrent]: Redis[F, TxResult[A]]

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product