Transaction:
Redis transaction can execute multiple commands once the transaction has the following characteristics:
1 , isolation operations: all command sequence of a transaction are performed in sequence, other commands will not be disturbed.
2 , the operating atomic: either all commands in the transaction is executed or all not performed.
# Open a transaction: (after opening, execute any commands are run in this transaction!)
Multi (open transaction)
Exec (commit the transaction)
discard (roll back the transaction)
#
# Rollback
reids publish-and-subscribe (same terminal)
&> Subscribe to a channel (a channel monitor)
subscribe channel
subscrib test1
& 2> posted a message to a channel
publish channel message
publish test1 123
&> View