Finalizes the transaction by executing MULTI on the server.
public multi ( ) : |
||
return |
/** * Remove the expired jobs from a given queue. * * @param \Predis\Transaction\MultiExec $transaction * @param string $from * @param int $time * @return void */ protected function removeExpiredJobs($transaction, $from, $time) { $transaction->multi(); $transaction->zremrangebyscore($from, '-inf', $time); }
/** * @group disconnected * @expectedException \Predis\Response\ServerException * @expectedExceptionMessage ERR simulated failure on EXEC */ public function testExceptionsOptionDoesNotAffectTransactionControlCommands() { $connection = $this->getMockedConnection(function (CommandInterface $command) { switch ($command->getId()) { case 'MULTI': return true; case 'EXEC': return new Response\Error('ERR simulated failure on EXEC'); default: return new Response\Status('QUEUED'); } }); $client = new Client($connection, array('exceptions' => false)); $tx = new MultiExec($client); $tx->multi()->echo('test')->exec(); }