Is it possible to call a predis command outside of transaction context? I mean to exec hget or hexist while a transaction is opened
Asked
Active
Viewed 98 times
2 Answers
2
No, it`s not possible. Transaction started with (MULTI) works in per connection pipeline. So you should DISCARD/EXEC first or use another predis connection to Redis server.

Nick Bondarenko
- 6,211
- 4
- 35
- 56
0
You can do it, but not on the same connection.
Here's a transaction that copies foo2
value to foo
, foo2
is read by a second connection:
$responses = $client1->transaction()->set('foo', $client2->get('foo2'))->get('foo')->execute();

Ofir Luzon
- 10,635
- 3
- 41
- 52
-
-
@misterion, I'm performing a redis call while a transaction is still open. I think that this is what the OP wanted. – Ofir Luzon Jan 13 '16 at 07:02