public function testMixingMultiAndPipeline() { $this->redis->multi(); try { $this->redis->pipeline(); $this->fail('Going from multi to pipeline mode should have thrown an exception'); } catch (MultiModeException $e) { // everything is fine here } try { // make sure multi mode is disabled $this->redis->discard(); } catch (MultiModeException $e) { // disregard } $this->redis->pipeline(); try { $this->redis->multi(); $this->fail('Going from pileline to multi mode should have thrown an exception'); } catch (MultiModeException $e) { // everything is fine here } try { // make sure multi mode is disabled $this->redis->discard(); } catch (MultiModeException $e) { // disregard } }
/** * Enter pipeline mode. * * This mode is quite similar to multi(), except that is does not provide the transaction * semantics. This means that the commands are queued by the client and sent to the server * in one batch for better performance, but no atomic execution is guaranteed. * * @see multi() * @return bool */ public function pipeline() { try { // no need to set the flag as we never read it return $this->client->pipeline(); } catch (Exception $e) { return $this->handleException($e, __FUNCTION__, func_get_args()); } }
/** * {@inheritdoc} */ public function pipeline() { $this->cache = array(); return $this->redis->pipeline(); }