1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use crate::;
use Serialize;
/// A group of Redis commands related to Transactions
///
/// # ⚠ These commands require a dedicated connection
///
/// The watched state belongs to the connection, not to the handle that asked
/// for it: on a shared connection any other caller can add keys to it, discard
/// it with [`unwatch`](TransactionCommands::unwatch), or consume it by running
/// its own `EXEC`. The trait is therefore implemented for
/// [`ExclusiveClient`](crate::client::ExclusiveClient) alone, and not for the
/// clonable [`Client`](crate::client::Client).
///
/// A transaction itself needs nothing of the sort: `MULTI`/`EXEC` are queued
/// and sent as one block, so
/// [`Client::create_transaction`](crate::client::Client::create_transaction)
/// stays available on a multiplexed client. Only the optimistic-locking half —
/// `WATCH` — is restricted.
///
/// # See Also
/// [Redis Generic Commands](https://redis.io/commands/?group=transactions)